Skip to content

Commit

Permalink
kfifo: disable __kfifo_must_check_helper()
Browse files Browse the repository at this point in the history
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: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Oct 26, 2010
1 parent 1b627d5 commit 52c5171
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions include/linux/kfifo.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 52c5171

Please sign in to comment.