From: Markus Elfring Date: Fri, 11 Oct 2019 05:15:53 +0000 Subject: Re: Searching for missing variable checks Message-Id: List-Id: References: <75f70e5e-9ece-d6d1-a2c5-2f3ad79b9ccb@web.de> <954c5d70-742f-7b0e-57ad-ea967e93be89@rasmusvillemoes.dk> In-Reply-To: <954c5d70-742f-7b0e-57ad-ea967e93be89@rasmusvillemoes.dk> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Rasmus Villemoes , kernel-janitors@vger.kernel.org, Alexander Shishkin , Andrew Morton , Andy Shevchenko , Joe Perches , Kees Cook , Nick Desaulniers , Steven Rostedt , Aditya Pakki , Kangjie Lu , Navid Emamdoost , Stephen McCamant , Coccinelle Cc: LKML > The problem is the __must_check does not mean that the > return value must be followed by a comparison to NULL and bailing out > (that can't really be checked), it simply ensures the return value is > assigned somewhere or used in an if(). So foo->bar = kstrdup() not > followed by a check of foo->bar won't warn. Higher level source code analysis tools like the semantic patch language (Coccinelle software) can help to find such missing checks. Would you like to point any additional development tools out for this purpose? Regards, Markus