Catégorie : Linux

drivers/ata/libata: Move dereference after NULL test

Author: Julia Lawall <julia@diku.dk> In each case, if the NULL test on qc is needed, then the derefernce should be after the NULL test. A simplified version of the semantic match that detects this problem is as follows (http://coccinelle.lip6.fr/): // @match exists@ expression x, E; identifier fld; @@ * x->fld … when != \(x = …

Lire la suite

ACPI: Move dereference after NULL test

Author: Julia Lawall <julia@diku.dk> If the NULL test on pr is needed, then the dereference should be after the NULL test. A simplified version of the semantic match that detects this problem is as follows (http://coccinelle.lip6.fr/): // @match exists@ expression x, E; identifier fld; @@ * x->fld … when != \(x = E\|&x\) * x …

Lire la suite

ALSA: sound/parisc: Move dereference after NULL test

Author: Julia Lawall <julia@diku.dk> If the NULL test on h is needed in snd_harmony_mixer_init, then the dereference should be after the NULL test. Actually, there is a sequence of calls: snd_harmony_create, then snd_harmony_pcm_init, and then snd_harmony_mixer_init. snd_harmony_create initializes h, but may indeed leave it as NULL. There was no NULL test at the beginning of …

Lire la suite

ALSA: sound: Move dereference after NULL test and drop unnecessary NULL tests

Author: Julia Lawall <julia@diku.dk> In pcm.c, if the NULL test on pcm is needed, then the dereference should be after the NULL test. In dummy.c and ali5451.c, the context of the calls to snd_card_dummy_new_mixer and snd_ali_free_voice show that dummy and pvoice, respectively cannot be NULL. A simplified version of the semantic match that detects this …

Lire la suite

ASoC: Move dereference after NULL test

Author: Julia Lawall <julia@diku.dk> If the NULL test on jack is needed, then the derefernce should be after the NULL test. A simplified version of the semantic match that detects this problem is as follows (http://coccinelle.lip6.fr/): // @match exists@ expression x, E; identifier fld; @@ * x->fld … when != \(x = E\|&x\) * x …

Lire la suite

drivers/serial/mpc52xx_uart.c: Use UPIO_MEM rather than SERIAL_IO_MEM

Author: Julia Lawall <julia@diku.dk> As in the commit 9b4a1617772d6d5ab5eeda0cd95302fae119e359, use UPIO_MEM rather than SERIAL_IO_MEM. Both have the same value. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @has_sc@ @@ #include @depends on has_sc@ @@ – SERIAL_IO_MEM + UPIO_MEM // Signed-off-by: Julia Lawall Signed-off-by: Grant Likely — drivers/serial/mpc52xx_uart.c | 2 +- 1 …

Lire la suite

omap: iovmm: Add missing mutex_unlock

Author: Daniel Walker <dwalker@fifo99.com> I was using Coccinelle with the mutex_unlock semantic patch, and it unconvered this problem. It appears to be a valid missing unlock issue. This change should correct it by moving the unlock below the label. This patch is against the mainline kernel. Cc: Julia Lawall Cc: Hiroshi DOYU Signed-off-by: Daniel Walker …

Lire la suite

Btrfs: 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

RDMA/nes: Remove duplicate .ndo_set_mac_address field initialization

Author: Julia Lawall <julia@diku.dk> The definition of nes_netdev_ops has initializations of a local function and eth_mac_addr for its ndo_set_mac_address field. This change uses only the local function. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r@ identifier I, s, fld; position p0,p; expression E; @@ struct I s =@p0 { … …

Lire la suite

drivers/vlynq/vlynq.c: fix resource size off by 1 error

Author: Julia Lawall <julia@diku.dk> In this case, the calls to request_mem_region, ioremap, and release_mem_region all have a consistent length argument, len, but since in other files (res->end – res->start) + 1, equivalent to resource_size(res), is used for a resource-typed structure res, one could consider whether the same should be done here. The problem was found …

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.