*new* return_negative_var: returning positive values instead negative in the kernel
commitafaf527a0ebb6a48b612b6da3cbaf93ff081abbc
authorDan Carpenter <error27@gmail.com>
Thu, 9 Jun 2011 21:35:22 +0000 (10 00:35 +0300)
committerDan Carpenter <error27@gmail.com>
Thu, 9 Jun 2011 21:35:22 +0000 (10 00:35 +0300)
tree2020ebf5ca7af27afc0e4c2f415bef632cda4eac
parent549b9579653693cd6368ccae183717c175400141
*new* return_negative_var: returning positive values instead negative in the kernel

It's normally an error to do:
return -PTR_ERR(foo);

If you have --spammy enabled then this test also complains when you do:
foo = some_func();
return -foo;

There are a couple places where that is valid such as XFS and some of the
networking code, but often it's a bug.

Signed-off-by: Dan Carpenter <error27@gmail.com>
check_list.h
check_return_negative_var.c [new file with mode: 0644]