Skip to content

Commit c20bdc0

Browse files
tklausergregkh
authored andcommitted
x86/mpx: Use compatible types in comparison to fix sparse error
[ Upstream commit 453828625731d0ba7218242ef6ec88f59408f368 ] info->si_addr is of type void __user *, so it should be compared against something from the same address space. This fixes the following sparse error: arch/x86/mm/mpx.c:296:27: error: incompatible types in comparison expression (different address spaces) Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 14339b0 commit c20bdc0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

arch/x86/mm/mpx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ siginfo_t *mpx_generate_siginfo(struct pt_regs *regs)
293293
* We were not able to extract an address from the instruction,
294294
* probably because there was something invalid in it.
295295
*/
296-
if (info->si_addr == (void *)-1) {
296+
if (info->si_addr == (void __user *)-1) {
297297
err = -EINVAL;
298298
goto err_out;
299299
}

0 commit comments

Comments
 (0)