From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcel Holtmann Subject: Re: [PATCH 4/7] net/bluetooth/rfcomm/core.c: fix error return code Date: Wed, 29 Aug 2012 11:23:29 -0700 Message-ID: <1346264609.23377.6.camel@aeonflux> References: <1346258957-7649-1-git-send-email-Julia.Lawall@lip6.fr> <1346258957-7649-5-git-send-email-Julia.Lawall@lip6.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Gustavo Padovan , Johan Hedberg , "David S. Miller" , linux-bluetooth-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Julia Lawall Return-path: In-Reply-To: <1346258957-7649-5-git-send-email-Julia.Lawall-L2FTfq7BK8M@public.gmane.org> Sender: linux-bluetooth-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: netdev.vger.kernel.org Hi Julia, > Initialize return variable before exiting on an error path. > > A simplified version of the semantic match that finds this problem is as > follows: (http://coccinelle.lip6.fr/) > > // > ( > if@p1 (\(ret < 0\|ret != 0\)) > { ... return ret; } > | > ret@p1 = 0 > ) > ... when != ret = e1 > when != &ret > *if(...) > { > ... when != ret = e2 > when forall > return ret; > } > > // > > Signed-off-by: Julia Lawall > > --- > net/bluetooth/rfcomm/core.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) Acked-by: Marcel Holtmann Regards Marcel