Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] as102: fix error return code

Return a negative error code on failure.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
identifier ret; expression e1,e2;
@@
(
if (\(ret < 0\|ret != 0\))
{ ... return ret; }
|
ret = 0
)
... when != ret = e1
when != &ret
*if(...)
{
... when != ret = e2
when forall
return ret;
}
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

authored by

Julia Lawall and committed by
Mauro Carvalho Chehab
bfe40b79 50f2468e

+1
+1
drivers/media/usb/as102/as102_drv.c
··· 337 337 &as102_dev->bus_adap, 338 338 as102_dev->elna_cfg); 339 339 if (!as102_dev->dvb_fe) { 340 + ret = -ENODEV; 340 341 dev_err(dev, "%s: as102_attach() failed: %d", 341 342 __func__, ret); 342 343 goto efereg;