slub: remove invalid reference to list iterator variable

Author: Julia Lawall <Julia.Lawall@lip6.fr> If list_for_each_entry, etc complete a traversal of the list, the iterator variable ends up pointing to an address at an offset from the list head, and not a meaningful structure. Thus this value should not be used after the end of the iterator. The patch replaces s->name by al->name, which is …

Lire la suite

drivers/net/ethernet/broadcom/cnic.c: remove invalid reference to list iterator variable

Author: Julia Lawall <Julia.Lawall@lip6.fr> If list_for_each_entry, etc complete a traversal of the list, the iterator variable ends up pointing to an address at an offset from the list head, and not a meaningful structure. Thus this value should not be used after the end of the iterator. There does not seem to be a meaningful …

Lire la suite

net/rxrpc/ar-peer.c: remove invalid reference to list iterator variable

Author: Julia Lawall <Julia.Lawall@lip6.fr> If list_for_each_entry, etc complete a traversal of the list, the iterator variable ends up pointing to an address at an offset from the list head, and not a meaningful structure. Thus this value should not be used after the end of the iterator. This seems to be a copy-paste bug from …

Lire la suite

drivers/isdn/mISDN/stack.c: remove invalid reference to list iterator variable

Author: Julia Lawall <Julia.Lawall@lip6.fr> If list_for_each_entry, etc complete a traversal of the list, the iterator variable ends up pointing to an address at an offset from the list head, and not a meaningful structure. Thus this value should not be used after the end of the iterator. The dereferences are just deleted from the debugging …

Lire la suite

driver-core: Move kobj_to_dev from genhd.h to device.h

Author: Lars-Peter Clausen <lars@metafoo.de> This function is not really specific to the genhd layer and there are various re-implementations or open-coded variants of it all throughout the kernel. To avoid further duplications move the function to a more generic place. While moving also convert it from a macro to a inline function. Potential users of …

Lire la suite

iio:adc:at91: Relase mutex on error path in at91_adc_read_raw

Author: Lars-Peter Clausen <lars@metafoo.de> This issue was reported by the mini_lock.cocci coccinelle semantic patch. Signed-off-by: Lars-Peter Clausen Acked-by: Maxime Ripard Acked-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman — drivers/iio/adc/at91_adc.c | 6 ++++– 1 file changed, 4 insertions(+), 2 deletions(-)   diff –git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c index 6a08469..f61780a 100644 — a/drivers/iio/adc/at91_adc.c +++ b/drivers/iio/adc/at91_adc.c @@ -349,9 +349,11 @@ static …

Lire la suite

drivers/ide/ide-cs.c: adjust suspicious bit operation

Author: Julia Lawall <Julia.Lawall@lip6.fr> IO_DATA_PATH_WIDTH_8 is 0, so a bit-and with it is always false. The value IO_DATA_PATH_WIDTH covers the bits of the IO_DATA_PATH constants, so first pick those bits and then make the test using !=. This problem was found using Coccinelle (http://coccinelle.lip6.fr/). Signed-off-by: Julia Lawall Signed-off-by: David S. Miller — drivers/ide/ide-cs.c | 3 …

Lire la suite

fs/direct-io.c: adjust suspicious bit operation

Author: Julia Lawall <Julia.Lawall@lip6.fr> READ is 0, so the result of the bit-and operation is 0. Rewrite with == as done elsewhere in the same file. This problem was found using Coccinelle (http://coccinelle.lip6.fr/). Signed-off-by: Julia Lawall Reviewed-by: Jeff Moyer Cc: Al Viro Signed-off-by: Andrew Morton Signed-off-by: Al Viro — fs/direct-io.c | 2 +- 1 file …

Lire la suite

drivers/ata/pata_pcmcia.c: adjust suspicious bit operation

Author: Julia Lawall <Julia.Lawall@lip6.fr> IO_DATA_PATH_WIDTH_8 is 0, so a bit-and with it is always false. The value IO_DATA_PATH_WIDTH covers the bits of the IO_DATA_PATH constants, so first pick those bits and then make the test using !=. This problem was found using Coccinelle (http://coccinelle.lip6.fr/). Signed-off-by: Julia Lawall Signed-off-by: Jeff Garzik — drivers/ata/pata_pcmcia.c | 3 ++- …

Lire la suite

drivers/staging/comedi/drivers/me4000.c: adjust suspicious bit operation

Author: Julia Lawall <Julia.Lawall@lip6.fr> TRIG_ROUND_NEAREST is 0, so a bit-and with it is always false. The value TRIG_ROUND_MASK covers the bits of the TRIG_ROUND constants, so first pick those bits and then make the test using ==. The same is done for TRIG_ROUND_UP for symmetry, even though bit-and would be sufficient in this case. This …

Lire la suite