Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 52c51712 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds
Browse files

kfifo: disable __kfifo_must_check_helper()



This helper is wrong: it coerces signed values into unsigned ones, so code
such as

	if (kfifo_alloc(...) < 0) {
		error
	}

will fail to detect the error.

So let's disable __kfifo_must_check_helper() for 2.6.36.

Cc: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Stefani Seibold <stefani@seibold.net>
Cc: <stable@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 1b627d57
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -171,11 +171,8 @@ struct kfifo_rec_ptr_2 __STRUCT_KFIFO_PTR(unsigned char, 2, void);
	}


static inline unsigned int __must_check
__kfifo_must_check_helper(unsigned int val)
{
	return val;
}
/* __kfifo_must_check_helper() is temporarily disabled because it was faulty */
#define __kfifo_must_check_helper(x) (x)

/**
 * kfifo_initialized - Check if the fifo is initialized