[media] drivers/media/pci/cx25821/cx25821-video-upstream-ch2.c: fix error return...
authorPeter Senna Tschudin <peter.senna@gmail.com>
Sat, 8 Sep 2012 13:01:58 +0000 (10:01 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 22 Nov 2012 17:39:11 +0000 (15:39 -0200)
commiteaddb09307494646650e7c7432739ade10bdf56c
treed713bf71ebf3a5c34403761f2fcf94e0e5258a82
parent304a0807a22852fe3095a62c24b25c4d0e16d003
[media] drivers/media/pci/cx25821/cx25821-video-upstream-ch2.c: fix error return code

Convert a nonnegative error return code to a negative one, as returned
elsewhere in the function.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
(
if@p1 (\(ret < 0\|ret != 0\))
 { ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
    when != &ret
*if(...)
{
  ... when != ret = e2
      when forall
 return ret;
}
// </smpl>

While here, replace strlen()+kmemdup() to kstrdup().

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Reviewed-by: walter harms <wharms@bfs.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/pci/cx25821/cx25821-video-upstream-ch2.c