Author: Julia Lawall <julia@diku.dk> At the point of the print, dev is NULL. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r exists@ expression E,E1; identifier f; statement S1,S2,S3; @@ if ((E == NULL && …) || …) { … when != if (…) S1 else S2 …
Category: Linux
May 27 2010
drivers/platform/x86: Eliminate a NULL pointer dereference
Author: Julia Lawall <julia@diku.dk> Give different error messages if device_enum is NULL or if its type field has the wrong value. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r exists@ expression E,E1; identifier f; statement S1,S2,S3; @@ if ((E == NULL && …) || …) { …
May 27 2010
USB: host: Eliminate NULL dereference
Author: Julia Lawall <julia@diku.dk> The test above allows std to be NULL, so check that std is not NULL before doing the dereference. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r exists@ expression E,E1; identifier f; statement S1,S2,S3; @@ if ((E == NULL && …) || …
May 27 2010
Staging: Eliminate a NULL pointer dereference
Author: Julia Lawall <julia@diku.dk> Eliminate a NULL or near NULL pointer dereference. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r exists@ expression E,E1; identifier f; statement S1,S2,S3; @@ if ((E == NULL && …) || …) { … when != if (…) S1 else S2 when …
May 27 2010
V4L/DVB: drivers/media: Eliminate a NULL pointer dereference
Author: Julia Lawall <julia@diku.dk> In each case, the print involves dereferencing a value that is NULL or is near NULL. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r exists@ expression E,E1; identifier f; statement S1,S2,S3; @@ if ((E == NULL && …) || …) { … …
May 27 2010
[SCSI] hptiop: Eliminate a NULL pointer dereference
Author: Julia Lawall <julia@diku.dk> The end of the function is reachable both when host is and is not NULL. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r exists@ expression E,E1; identifier f; statement S1,S2,S3; @@ if ((E == NULL && …) || …) { … when …
May 27 2010
drivers/dma: Eliminate a NULL pointer dereference
Author: Julia Lawall <julia@diku.dk> If td_desc is NULL, just skip both kfrees. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r exists@ expression E,E1; identifier f; statement S1,S2,S3; @@ if ((E == NULL && …) || …) { … when != if (…) S1 else S2 when …
May 27 2010
[PATCH 2/11] drivers/watchdog: Eliminate a NULL pointer dereference
Author: Julia Lawall <julia@diku.dk> At the point of the call to dev_err, wm8350 is NULL. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r exists@ expression E,E1; identifier f; statement S1,S2,S3; @@ if ((E == NULL && …) || …) { … when != if (…) S1 …
May 27 2010
USB: serial: digi_acceleport: Eliminate a NULL pointer dereference
Author: Julia Lawall <julia@diku.dk> If port is NULL, then the call to dev_err will dereference a value that is a small offset from NULL. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r exists@ expression E,E1; identifier f; statement S1,S2,S3; @@ if ((E == NULL && …) …
May 27 2010
arch/x86/kernel: Add missing spin_unlock
Author: Julia Lawall <julia@diku.dk> Add a spin_unlock missing on the error path. The locks and unlocks are balanced in other functions, so it seems that the same should be the case here. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression E1; @@ * spin_lock(E1,…); * spin_unlock(E1,…); // Cc: stable@kernel.org …