Skip to content

Commit c2ff861

Browse files
petersennaherbertx
authored andcommitted
crypto: hifn_795x - 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> ( 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: Peter Senna Tschudin <peter.senna@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 79c09c1 commit c2ff861

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎drivers/crypto/hifn_795x.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2611,14 +2611,17 @@ static int __devinit hifn_probe(struct pci_dev *pdev, const struct pci_device_id
26112611
size = pci_resource_len(pdev, i);
26122612

26132613
dev->bar[i] = ioremap_nocache(addr, size);
2614-
if (!dev->bar[i])
2614+
if (!dev->bar[i]) {
2615+
err = -ENOMEM;
26152616
goto err_out_unmap_bars;
2617+
}
26162618
}
26172619

26182620
dev->desc_virt = pci_alloc_consistent(pdev, sizeof(struct hifn_dma),
26192621
&dev->desc_dma);
26202622
if (!dev->desc_virt) {
26212623
dprintk("Failed to allocate descriptor rings.\n");
2624+
err = -ENOMEM;
26222625
goto err_out_unmap_bars;
26232626
}
26242627
memset(dev->desc_virt, 0, sizeof(struct hifn_dma));

0 commit comments

Comments
 (0)