Category: Linux

drivers/net/hamradio: Eliminate a NULL pointer dereference

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 …

Continue reading

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 && …) || …) { …

Continue reading

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 && …) || …

Continue reading

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 …

Continue reading

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 && …) || …) { … …

Continue reading

[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 …

Continue reading

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 …

Continue reading

[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 …

Continue reading

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 && …) …

Continue reading

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 …

Continue reading