From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Date: Wed, 09 Sep 2009 14:42:19 +0000 Subject: Re: [PATCH 3/9] virt/kvm: correct error-handling code Message-Id: <4AA7BECB.2090903@redhat.com> List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Julia Lawall Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org On 07/28/2009 06:53 PM, Julia Lawall wrote: > From: Julia Lawall > > This code is not executed before file has been initialized to the result of > calling eventfd_fget. This function returns an ERR_PTR value in an error > case instead of NULL. Thus the test that file is not NULL is always true. > > A simplified version of the semantic match that finds this problem is as > follows: (http://coccinelle.lip6.fr/) > > // > @match exists@ > expression x, E; > statement S1, S2; > @@ > > x = eventfd_fget(...) > ... when != x = E > ( > * if (x = NULL || ...) S1 else S2 > | > * if (x = NULL&& ...) S1 else S2 > ) > // > > Applied, thanks (yes, old patch, missed it). -- error compiling committee.c: too many arguments to function