Catégorie : 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 …

Lire la suite

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

Lire la suite

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

Lire la suite

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 …

Lire la suite

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

Lire la suite

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

Lire la suite

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 …

Lire la suite

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

Lire la suite

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

Lire la suite

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 …

Lire la suite