Catégorie : Linux

USB: gadget: amd5536udc.c: Remove double test

Author: Julia Lawall <julia@diku.dk> The same expression is tested twice and the result is the same each time. Instead test for use_dma_ppb as in the test above. The sematic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @expression@ expression E; @@ ( * E || … || E | * E && … …

Lire la suite

net/wireless: Remove double test

Author: Julia Lawall <julia@diku.dk> The same expression is tested twice and the result is the same each time. The sematic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @expression@ expression E; @@ ( * E || … || E | * E && … && E ) // Signed-off-by: Julia Lawall Signed-off-by: John …

Lire la suite

V4L/DVB: drivers/media/dvb/siano: Remove double test

Author: Julia Lawall <julia@diku.dk> The same expression is tested twice and the result is the same each time. The sematic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @expression@ expression E; @@ ( * E || … || E | * E && … && E ) // Signed-off-by: Julia Lawall Signed-off-by: Mauro …

Lire la suite

x86, kmemcheck: Remove double test

Author: Julia Lawall <julia@diku.dk> The opcodes 0x2e and 0x3e are tested for in the first Group 2 line as well. The sematic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @expression@ expression E; @@ ( * E || … || E | * E && … && E ) // Signed-off-by: Julia Lawall …

Lire la suite

staging: rtl8193*: Remove double test

Author: Julia Lawall <julia@diku.dk> The 1 element of the array is tested twice. Change the code so that the remaining 3 element of the array is tested instead of testing the 1 element a second time. The sematic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @expression@ expression E; @@ ( * E …

Lire la suite

drivers/net/atl1c: Remove double test

Author: Julia Lawall <julia@diku.dk> The nic_type field is compared to athr_l2c twice. The sematic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @expression@ expression E; @@ ( * E || … || E | * E && … && E ) // Signed-off-by: Julia Lawall Signed-off-by: David S. Miller — drivers/net/atl1c/atl1c_hw.c | 2 …

Lire la suite

net/ipv4: Eliminate kstrdup memory leak

Author: Julia Lawall <julia@diku.dk> The string clone is only used as a temporary copy of the argument val within the while loop, and so it should be freed before leaving the function. The call to strsep, however, modifies clone, so a pointer to the front of the string is kept in saved_clone, to make it …

Lire la suite

V4L/DVB: drivers/media/video/em28xx: Remove potential NULL dereference

Author: Julia Lawall <julia@diku.dk> If the NULL test is necessary, the initialization involving a dereference of the tested value should be moved after the NULL test. The sematic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // @@ type T; expression E; identifier i,fld; statement S; @@ – T i = E->fld; + T …

Lire la suite

net/netfilter/ipvs: Eliminate memory leak

Author: Julia Lawall <julia@diku.dk> __ip_vs_service_get and __ip_vs_svc_fwm_get increment a reference count, so that reference count should be decremented before leaving the function in an error case. A simplified version of the semantic match that finds this problem is: (http://coccinelle.lip6.fr/) // @r exists@ local idexpression x; expression E; identifier f1; iterator I; @@ x = __ip_vs_service_get(…); …

Lire la suite

drivers/net/irda: Eliminate memory leak

Author: Julia Lawall <julia@diku.dk> dev_alloc_skb allocates some memory, so that memory should be freed before leaving the function in an error case. Corrected some typos in a nearby comment as well. A simplified version of the semantic match that finds this problem is: (http://coccinelle.lip6.fr/) // @r exists@ local idexpression x; expression E; identifier f1; iterator …

Lire la suite