Catégorie : Linux

USB: gadget: change simple_strtol to simple_strtoul

Author: Julia Lawall <julia@diku.dk> Since num is unsigned, it would seem better to use simple_strtoul that simple_strtol. A simplified version of the semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @r2@ long e; position p; @@ e = simple_strtol@p(…) @@ position p != r2.p; type T; T e; @@ e = – …

Lire la suite

arch/x86/kernel/pci-calgary_64.c: change simple_strtol to simple_strtoul

Author: Julia Lawall <julia@diku.dk> Impact: fix theoretical option string parsing overflow Since bridge is unsigned, it would seem better to use simple_strtoul that simple_strtol. A simplified version of the semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @r2@ long e; position p; @@ e = simple_strtol@p(…) @@ position p != r2.p; type …

Lire la suite

MIPS: Alchemy: Change strict_strtol to strict_strtoul

Author: Julia Lawall <julia@diku.dk> Since memsize is unsigned, it would seem better to use strict_strtoul that strict_strtol. A simplified version of the semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @s2@ long e; position p; @@ strict_strtol@p(…,&e) @@ position p != s2.p; type T; T e; @@ – strict_strtol@p + strict_strtoul (…,&e) …

Lire la suite

arch/avr32: Eliminate NULL test and memset after alloc_bootmem

Author: Julia Lawall <julia@diku.dk> As noted by Akinobu Mita in patch b1fceac2b9e04d278316b2faddf276015fc06e3b, alloc_bootmem and related functions never return NULL and always return a zeroed region of memory. Thus a NULL test or memset after calls to these functions is unnecessary. This was fixed using the following semantic patch. (http://www.emn.fr/x-info/coccinelle/) // @@ expression E; statement S; …

Lire la suite

drivers/pci/hotplug: Add missing pci_dev_get

Author: Julia Lawall <julia@diku.dk> pci_get_slot does a pci_dev_get, so pci_dev_put needs to be called in an error case. An alterative would be to move the test_and_set_bit before the call to pci_get_slot. The problem was fixed using the following semantic patch. (http://www.emn.fr/x-info/coccinelle/) // @@ local idexpression *n; statement S1,S2; expression E,E1; expression *ptr != NULL; type …

Lire la suite

powerpc: Eliminate NULL test and memset after alloc_bootmem

Author: Julia Lawall <julia@diku.dk> As noted by Akinobu Mita in commit b1fceac2 (« x86: remove unnecessary memset and NULL check after alloc_bootmem() »), alloc_bootmem and related functions never return NULL and always return a zeroed region of memory. Thus a NULL test or memset after calls to these functions is unnecessary. This was fixed using the following …

Lire la suite

drivers/video/backlight/da903x.c: 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,l; position p1,p2; expression *ptr != NULL; @@ ( if ((x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(…)) == NULL) S | x@p1 …

Lire la suite

drivers/video: bad error test before a dereference

Author: Julien Brunel <brunel@diku.dk> The error test that follows the call to backlight_device_register semms not to concern the right variable. A simplified version of the semantic match that finds this problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // @def0@ expression x; position p0; @@ x@p0 = backlight_device_register(…) @protected@ expression def0.x,E; position def0.p0; position p; statement S; @@ …

Lire la suite

trace: introduce missing mutex_unlock()

Author: Vegard Nossum <vegard.nossum@gmail.com> Impact: fix tracing buffer mutex leak in case of allocation failure This error was spotted by this semantic patch: http://www.emn.fr/x-info/coccinelle/mut.html It looks correct as far as I can tell. Please review. Signed-off-by: Vegard Nossum Signed-off-by: Steven Rostedt Signed-off-by: Ingo Molnar — kernel/trace/ring_buffer.c | 1 + 1 file changed, 1 insertion(+)   …

Lire la suite

ALSA: sound/pci/pcxhr/pcxhr.c: introduce missing kfree and pci_disable_device

Author: Julia Lawall <julia@diku.dk> Error handling code following a kzalloc should free the allocated data. The error handling code is adjusted to call pci_disable_device(pci); as well, as done later in the function 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,l; …

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.