From: Julia Lawall Date: Sat, 22 Dec 2012 03:40:28 +0000 (-0800) Subject: [SCSI] bnx2fc: Remove potential NULL dereference X-Git-Tag: v3.9-rc1~45^2~43 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=33c7da0590d4e9e7420f8cf50722c4fe6932218f;p=pandora-kernel.git [SCSI] bnx2fc: Remove potential NULL dereference If the NULL test is necessary, the initialization involving a dereference of the tested value should be moved after the NULL test. The sematic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // @@ type T; expression E; identifier i,fld; statement S; @@ - T i = E->fld; + T i; ... when != E when != i if (E == NULL) S + i = E->fld; // Signed-off-by: Julia Lawall Signed-off-by: Bhanu Prakash Gollapudi Signed-off-by: James Bottomley --- Reading git-diff-tree failed