diff options
author | Julia Lawall <Julia.Lawall@lip6.fr> | 2012-08-16 21:46:58 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-08-20 02:33:21 -0700 |
commit | 9915e67eb1134b4710a4888a3e041c757869e0e2 (patch) | |
tree | 65703e668603fc428264d0fc39c32999efd9c80f /drivers/net/irda/ks959-sir.c | |
parent | 623d896b361f404de5ed24e312a58646ee04207d (diff) | |
download | linux-9915e67eb1134b4710a4888a3e041c757869e0e2.tar.bz2 |
drivers/net/irda: 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>
@@
identifier ret;
expression e1,e2;
@@
if (ret < 0)
{ ... return ret; }
... when != ret = e1
when forall
*if(...)
{
... when != ret = e2
* return ret;
}
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/irda/ks959-sir.c')
-rw-r--r-- | drivers/net/irda/ks959-sir.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/irda/ks959-sir.c b/drivers/net/irda/ks959-sir.c index 824e2a93fe8a..5f3aeac3f86d 100644 --- a/drivers/net/irda/ks959-sir.c +++ b/drivers/net/irda/ks959-sir.c @@ -542,6 +542,7 @@ static int ks959_net_open(struct net_device *netdev) sprintf(hwname, "usb#%d", kingsun->usbdev->devnum); kingsun->irlap = irlap_open(netdev, &kingsun->qos, hwname); if (!kingsun->irlap) { + err = -ENOMEM; dev_err(&kingsun->usbdev->dev, "irlap_open failed\n"); goto free_mem; } |