err.h: add __must_check to error pointer handlers
authorJani Nikula <[email protected]>
Mon, 24 May 2010 21:33:00 +0000 (14:33 -0700)
committerLinus Torvalds <[email protected]>
Tue, 25 May 2010 15:07:02 +0000 (08:07 -0700)
commite47103b1af5df52fa69e18b14d3012472f78817d
tree6652e56e361415a85ab5a7b888492e5ceef0cd94
parent1f85f87d4f81d1e5a2d502d48316a1bdc5acac0b
err.h: add __must_check to error pointer handlers

Add __must_check to error pointer handlers to have the compiler warn about
mistakes like:

if (err)
ERR_PTR(err);

It found two bugs:

Mar 12 Nikula Jani [PATCH] enclosure: fix error path - actually return ERR_PTR() on error
Mar 12 Nikula Jani [PATCH] sunrpc: fix error path - actually return ERR_PTR() on error

Signed-off-by: Jani Nikula <[email protected]>
Cc: Phil Carmody <[email protected]>
Cc: Alexey Dobriyan <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
include/linux/err.h