lkml.org 
[lkml]   [2008]   [Sep]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] net/xfrm: Use an IS_ERR test rather than a NULL test
From
From: Julien Brunel <brunel@diku.dk>
Date: Mon, 1 Sep 2008 10:53:33 +0200

> In case of error, the function xfrm_bundle_create returns an ERR
> pointer, but never returns a NULL pointer. So a NULL test that comes
> after an IS_ERR test should be deleted.
>
> The semantic match that finds this problem is as follows:
> (http://www.emn.fr/x-info/coccinelle/)
>
> // <smpl>
> @match_bad_null_test@
> expression x, E;
> statement S1,S2;
> @@
> x = xfrm_bundle_create(...)
> ... when != x = E
> * if (x != NULL)
> S1 else S2
> // </smpl>
>
> Signed-off-by: Julien Brunel <brunel@diku.dk>
> Signed-off-by: Julia Lawall <julia@diku.dk>

Looks good, patch applied, thanks.


\
 
 \ /
  Last update: 2008-09-03 02:29    [W:0.028 / U:0.392 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site