]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/2.6.36.2/kfifo-disable-__kfifo_must_check_helper.patch
Remove duplicated commits
[thirdparty/kernel/stable-queue.git] / releases / 2.6.36.2 / kfifo-disable-__kfifo_must_check_helper.patch
1 From 52c5171214ff3327961d0ce0db7e8d2ce55004fd Mon Sep 17 00:00:00 2001
2 From: Andrew Morton <akpm@linux-foundation.org>
3 Date: Tue, 26 Oct 2010 14:21:19 -0700
4 Subject: kfifo: disable __kfifo_must_check_helper()
5
6 From: Andrew Morton <akpm@linux-foundation.org>
7
8 commit 52c5171214ff3327961d0ce0db7e8d2ce55004fd upstream.
9
10 This helper is wrong: it coerces signed values into unsigned ones, so code
11 such as
12
13 if (kfifo_alloc(...) < 0) {
14 error
15 }
16
17 will fail to detect the error.
18
19 So let's disable __kfifo_must_check_helper() for 2.6.36.
20
21 Cc: Randy Dunlap <randy.dunlap@oracle.com>
22 Cc: Stefani Seibold <stefani@seibold.net>
23 Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
24 Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
25 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
26
27 ---
28 include/linux/kfifo.h | 7 ++-----
29 1 file changed, 2 insertions(+), 5 deletions(-)
30
31 --- a/include/linux/kfifo.h
32 +++ b/include/linux/kfifo.h
33 @@ -171,11 +171,8 @@ struct kfifo_rec_ptr_2 __STRUCT_KFIFO_PT
34 }
35
36
37 -static inline unsigned int __must_check
38 -__kfifo_must_check_helper(unsigned int val)
39 -{
40 - return val;
41 -}
42 +/* __kfifo_must_check_helper() is temporarily disabled because it was faulty */
43 +#define __kfifo_must_check_helper(x) (x)
44
45 /**
46 * kfifo_initialized - Check if the fifo is initialized