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>
This commit is contained in:
parent
623d896b36
commit
9915e67eb1
2 changed files with 2 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -436,6 +436,7 @@ static int ksdazzle_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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue