Catégorie : Linux

[SCSI] mpt2sas: take size of pointed value, not pointer

Author: Julia Lawall <julia@diku.dk> Sizeof a pointer-typed expression returns the size of the pointer, not that of the pointed data. The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression *e; type T; identifier f; @@ f(…,(T)e,…, -sizeof(e) +sizeof(*e) ,…) // Signed-off-by: Julia Lawall Signed-off-by: James Bottomley — drivers/scsi/mpt2sas/mpt2sas_transport.c | 2 …

Lire la suite

drivers/staging/mei/interface.c: take size of pointed value, not pointer

Author: Julia Lawall <julia@diku.dk> Sizeof a pointer-typed expression returns the size of the pointer, not that of the pointed data. The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression *e; type T; identifier f; @@ f(…,(T)e,…, -sizeof(e) +sizeof(*e) ,…) // Signed-off-by: Julia Lawall Signed-off-by: Greg Kroah-Hartman — drivers/staging/mei/interface.c | 4 …

Lire la suite

drivers/char/msm_smd_pkt.c: don’t use IS_ERR()

Author: Thomas Meyer <thomas@m3y3r.de> The various basic memory allocation function return NULL, not an ERR_PTR. The semantic patch that makes this change is available in scripts/coccinelle/null/eno.cocci. More information about semantic patching is available at http://coccinelle.lip6.fr/ Signed-off-by: Thomas Meyer Cc: Niranjana Vishwanathapura Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds — drivers/char/msm_smd_pkt.c | 5 ++— 1 file changed, …

Lire la suite

[S390] drivers/s390/block/dasd_ioctl.c: add missing kfree

Author: Julia Lawall <julia@diku.dk> Data is only used to temporarily hold information to be copied to the user level, so it should be freed before leaving the function. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @exists@ local idexpression x; statement S,S1; expression E; identifier fl; expression …

Lire la suite

drivers/net/wireless/mwifiex/scan.c: test the just-initialized value

Author: Julia Lawall <julia@diku.dk> Test the just-initialized value rather than some other one. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r@ identifier x,y,f!={PTR_ERR,ERR_PTR,ERR_CAST}; statement S; @@ x = f(…); ( if (\(x == NULL\|IS_ERR(x)\)) S | *if (\(y == NULL\|IS_ERR(y)\)) { … when != x return …; } ) // …

Lire la suite

drivers/usb/host/ohci-omap3.c: test the just-initialized value

Author: Julia Lawall <julia@diku.dk> Test the just-initialized value rather than some other one. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r@ identifier x,y,f!={PTR_ERR,ERR_PTR,ERR_CAST}; statement S; @@ x = f(…); ( if (\(x == NULL\|IS_ERR(x)\)) S | *if (\(y == NULL\|IS_ERR(y)\)) { … when != x return …; } ) // …

Lire la suite

drivers/staging/usbip/userspace/libsrc/vhci_driver.c: test the just-initialized value

Author: Julia Lawall <julia@diku.dk> Test the just-initialized value rather than some other one. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r@ identifier x,y,f!={PTR_ERR,ERR_PTR,ERR_CAST}; statement S; @@ x = f(…); ( if (\(x == NULL\|IS_ERR(x)\)) S | *if (\(y == NULL\|IS_ERR(y)\)) { … when != x return …; } ) // …

Lire la suite

sound/soc/mxs/mxs-saif.c: add missing kfree

Author: Julia Lawall <julia@diku.dk> Move the test on pdev->id before the kzalloc to avoid requiring kfree when the test fails. This fix was suggested by Wolfram Sang. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ identifier x; expression E1!=0,E2,E3,E4; statement S; iterator I; @@ ( if …

Lire la suite

powerpc/powermac: Add missing of_node_put

Author: Julia Lawall <julia@diku.dk> np is initialized to the result of calling a function that calls of_node_get, so of_node_put should be called before the pointer is dropped. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression e,e1,e2; @@ * e = \(of_find_node_by_type\|of_find_node_by_name\)(…) … when != of_node_put(e) when != true e …

Lire la suite

powerpc/cell/iommu: Add missing of_node_put

Author: Julia Lawall <julia@diku.dk> np is initialized to the result of calling a function that calls of_node_get, so of_node_put should be called before the pointer is dropped. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression e,e1,e2; @@ * e = \(of_find_node_by_type\|of_find_node_by_name\)(…) … when != of_node_put(e) when != true e …

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.