]> git.baikalelectronics.ru Git - kernel.git/commit
[media] drivers/media/usb/{s2255drv.c, tm6000/tm6000-alsa.c, tm6000/tm6000-input...
authorJulia Lawall <Julia.Lawall@lip6.fr>
Tue, 14 Aug 2012 14:49:46 +0000 (11:49 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 15 Aug 2012 22:02:27 +0000 (19:02 -0300)
commitbbce6284787b0065447ee41ca5399db3be4327ff
treec0c3e08fd6d77d429a9c04f49b7ace94965b7b94
parent0b3e2e5487b4d59705e2dc4608d6b1cd2781e891
[media] drivers/media/usb/{s2255drv.c, tm6000/tm6000-alsa.c, tm6000/tm6000-input.c}: Remove potential NULL dereferences

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/)

// <smpl>
@@
type T;
expression E;
identifier i,fld;
statement S;
@@

- T i = E->fld;
+ T i;
  ... when != E
      when != i
  if (E == NULL) S
+ i = E->fld;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/usb/s2255/s2255drv.c
drivers/media/usb/tm6000/tm6000-alsa.c
drivers/media/usb/tm6000/tm6000-input.c