提交 d07875bd 编写于 作者: J Julia Lawall 提交者: Roland Dreier

RDMA/nes: Fix error return code

Set the return variable to an error code as done 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>
Signed-off-by: NJulia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: NRoland Dreier <roland@purestorage.com>
上级 38dbfb59
...@@ -675,8 +675,11 @@ static int nes_probe(struct pci_dev *pcidev, const struct pci_device_id *ent) ...@@ -675,8 +675,11 @@ static int nes_probe(struct pci_dev *pcidev, const struct pci_device_id *ent)
INIT_DELAYED_WORK(&nesdev->work, nes_recheck_link_status); INIT_DELAYED_WORK(&nesdev->work, nes_recheck_link_status);
/* Initialize network devices */ /* Initialize network devices */
if ((netdev = nes_netdev_init(nesdev, mmio_regs)) == NULL) netdev = nes_netdev_init(nesdev, mmio_regs);
if (netdev == NULL) {
ret = -ENOMEM;
goto bail7; goto bail7;
}
/* Register network device */ /* Register network device */
ret = register_netdev(netdev); ret = register_netdev(netdev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册