From: Julia Lawall <hidden> Date: 2012-08-19 08:45:54
From: Julia Lawall <redacted>
Initialize return variable before exiting on an error path.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
(
if at p1 (\(ret < 0\|ret != 0\))
{ ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
when != &ret
*if(...)
{
... when != ret = e2
when forall
return ret;
}
// </smpl>
Signed-off-by: Julia Lawall <redacted>
---
Perhaps -EINVAL is not the right value in this case.
drivers/spi/spi-s3c24xx.c | 1 +
1 file changed, 1 insertion(+)
From: Kukjin Kim <hidden> Date: 2012-08-22 09:38:41
Julia Lawall wrote:
From: Julia Lawall <redacted>
Initialize return variable before exiting on an error path.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
(
if at p1 (\(ret < 0\|ret != 0\))
{ ... return ret; }
|
ret at p1 = 0
)
... when != ret = e1
when != &ret
*if(...)
{
... when != ret = e2
when forall
return ret;
}
// </smpl>
Signed-off-by: Julia Lawall <redacted>
Acked-by: Kukjin Kim <redacted>
(Cc'ed Mark Brown who is handling spi for a moment)
---
Perhaps -EINVAL is not the right value in this case.
Well, if (pin_cs < 0) is true, it is really invalid value. So I think, it
makes sense :-)
Thanks.
Best regards,
Kgene.
--
Kukjin Kim [off-list ref], Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
From: Julia Lawall <hidden> Date: 2012-08-22 11:42:53
From: Julia Lawall <redacted>
Initialize return variable before exiting on an error path.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
(
if at p1 (\(ret < 0\|ret != 0\))
{ ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
when != &ret
*if(...)
{
... when != ret = e2
when forall
return ret;
}
// </smpl>
Signed-off-by: Julia Lawall <redacted>
---
Perhaps -EINVAL is not the right value in this case.
drivers/spi/spi-s3c24xx.c | 1 +
1 file changed, 1 insertion(+)