Catégorie : Linux

drivers/net/wireless: introduce missing kfree

Author: Julia Lawall <julia@diku.dk> Error handling code following a kzalloc should free the allocated data. The semantic match that finds the problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // @r exists@ local idexpression x; statement S; expression E; identifier f,f1,l; position p1,p2; expression *ptr != NULL; @@ x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(…); … if (x == NULL) S f1 …

Lire la suite

powerpc/qe: introduce missing kfree

Author: Julia Lawall <julia@diku.dk> Error handling code following a kzalloc should free the allocated data. The semantic match that finds the problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // @r exists@ local idexpression x; statement S; expression E; identifier f,f1,l; position p1,p2; expression *ptr != NULL; @@ x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(…); … if (x == NULL) S f1 …

Lire la suite

fujitsu-laptop: Correct redundant test

Author: Julia Lawall <julia@diku.dk> device and acpi_driver_data(device) were tested just a few lines above. A simplified version of the semantic match that finds this problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // @r exists@ local idexpression x; expression E; @@ if (x == NULL || …) { … when forall return …; } .. when != \(x=E\|x–\|x++\|–x\|++x\|x-=E\|x+=E\|x|=E\|x&=E\|&x\) …

Lire la suite

ALSA: sound/aoa: Add kmalloc NULL tests

Author: Julia Lawall <julia@diku.dk> Check that the result of kzalloc is not NULL before a dereference. The semantic match that finds this problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // @@ expression *x; identifier f; constant char *C; @@ x = \(kmalloc\|kcalloc\|kzalloc\)(…); … when != x == NULL when != x != NULL when != (x || …

Lire la suite

net/netlabel: Add kmalloc NULL tests

Author: Julia Lawall <julia@diku.dk> The test on map4 should be a test on map6. The semantic match that finds this problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // @@ expression *x; identifier f; constant char *C; @@ x = \(kmalloc\|kcalloc\|kzalloc\)(…); … when != x == NULL when != x != NULL when != (x || …) ( …

Lire la suite

Staging: hv: Remove typedef STORVSC_REQUEST and PSTORVSC_REQUEST

Author: Nicolas Palix <npalix@diku.dk> typedef STORVSC_REQUEST and PSTORVSC_REQUEST are removed and their usages are replace by the use of struct hv_storvsc_request and struct hv_storvsc_request * respectively. Here is the semantic patch generated to perform this transformation: (http://coccinelle.lip6.fr/) // @rm_STORVSC_REQUEST@ @@ -typedef struct _STORVSC_REQUEST +struct hv_storvsc_request {…} -STORVSC_REQUEST ; @rm_PSTORVSC_REQUEST@ @@ -typedef struct _STORVSC_REQUEST *PSTORVSC_REQUEST; +struct …

Lire la suite

Staging: hv: Remove typedef NETVSC_PACKET and PNETVSC_PACKET

Author: Nicolas Palix <npalix@diku.dk> typedef NETVSC_PACKET and PNETVSC_PACKET are removed and their usages are replace by the use of struct hv_netvsc_packet and struct hv_netvsc_packet * respectively. Here is the semantic patch generated to perform this transformation: (http://coccinelle.lip6.fr/) // @rm_NETVSC_PACKET@ @@ -typedef struct _NETVSC_PACKET +struct hv_netvsc_packet {…} -NETVSC_PACKET ; @rm_PNETVSC_PACKET@ @@ -typedef struct _NETVSC_PACKET *PNETVSC_PACKET; +struct …

Lire la suite

Staging: hv: Remove typedef DRIVER_OBJECT and PDRIVER_OBJECT

Author: Nicolas Palix <npalix@diku.dk> typedef DRIVER_OBJECT and PDRIVER_OBJECT are removed and their usages are replace by the use of struct hv_driver and struct hv_driver * respectively. Here is the semantic patch generated to perform this transformation: (http://coccinelle.lip6.fr/) // @rm_DRIVER_OBJECT@ @@ -typedef struct _DRIVER_OBJECT +struct hv_driver {…} -DRIVER_OBJECT ; @rm_PDRIVER_OBJECT@ @@ -typedef struct _DRIVER_OBJECT *PDRIVER_OBJECT; +struct …

Lire la suite

KVM: correct error-handling code

Author: Julia Lawall <julia@diku.dk> This code is not executed before file has been initialized to the result of calling eventfd_fget. This function returns an ERR_PTR value in an error case instead of NULL. Thus the test that file is not NULL is always true. A simplified version of the semantic match that finds this problem …

Lire la suite

Staging: dst: correct error-handling code

Author: Julia Lawall <julia@diku.dk> dst_state_alloc returns an ERR_PTR value in an error case instead of NULL. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @match exists@ expression x, E; statement S1, S2; @@ x = dst_state_alloc(…) … when != x = E ( * if (x == …

Lire la suite

BtrLinux
Résumé de la politique de confidentialité

Ce site utilise des cookies afin que nous puissions vous fournir la meilleure expérience utilisateur possible. Les informations sur les cookies sont stockées dans votre navigateur et remplissent des fonctions telles que vous reconnaître lorsque vous revenez sur notre site Web et aider notre équipe à comprendre les sections du site que vous trouvez les plus intéressantes et utiles.