[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20090728163104.GA15033@pengutronix.de>
Date: Tue, 28 Jul 2009 18:31:04 +0200
From: Wolfram Sang <w.sang@...gutronix.de>
To: rtc-linux@...glegroups.com
Cc: p_gortmaker@...oo.com, a.zummo@...ertech.it,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [rtc-linux] [PATCH 7/9] drivers/rtc: correct error-handling
code
On Tue, Jul 28, 2009 at 05:55:33PM +0200, Julia Lawall wrote:
>
> From: Julia Lawall <julia@...u.dk>
>
> This code is not executed before ds1307->rtc has been successfully
> initialized to the result of calling rtc_device_register. Thus the test
> that ds1307->rtc is not NULL is always true.
>
> A simplified version of the semantic match that finds this problem is as
> follows: (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @match exists@
> expression x, E;
> statement S1, S2;
> @@
>
> x = rtc_device_register(...)
> ... when != x = E
> (
> * if (x == NULL || ...) S1 else S2
> |
> * if (x == NULL && ...) S1 else S2
> )
> // </smpl>
>
> Signed-off-by: Julia Lawall <julia@...u.dk>
Acked-by: Wolfram Sang <w.sang@...gutronix.de>
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Download attachment "signature.asc" of type "application/pgp-signature" (198 bytes)
Powered by blists - more mailing lists