drivers/crypto/ux500/cryp/cryp_core.c: fix error return code
Subsystems (3)
PATCH 1/4 drivers/crypto/ux500/cryp/cryp_core.c: fix error return code
From: Peter Senna Tschudin <[email protected]>
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>
--- drivers/crypto/ux500/cryp/cryp_core.c | 1 + 1 file changed, 1 insertion(+)
drivers/crypto/ux500/cryp/cryp_core.c +1 -0
@@ -1486,6 +1486,7 @@ static int ux500_cryp_probe(struct platform_device *pdev)if (!res_irq) {dev_err (dev,"[%s]: IORESOURCE_IRQ unavailable" , __func__); + ret = -ENODEV ; goto out_power; }
Signature · 1 line
1.7.11.4
PATCH 2/4 drivers/crypto/hifn_795x.c: fix error return code
From: Peter Senna Tschudin <[email protected]>
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>
--- drivers/crypto/hifn_795x.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/crypto/hifn_795x.c +4 -1
@@ -2611,14 +2611,17 @@ static int __devinit hifn_probe(struct pci_dev *pdev, const struct pci_device_id size =pci_resource_len (pdev, i); dev->bar[i] =ioremap_nocache (addr, size); -if (!dev->bar[i]) +if (!dev->bar[i]) { + err = -ENOMEM ; goto err_out_unmap_bars; + } } dev->desc_virt =pci_alloc_consistent (pdev,sizeof (struct hifn_dma ), &dev->desc_dma);if (!dev->desc_virt) {dprintk ("Failed to allocate descriptor rings.\n" ); + err = -ENOMEM ; goto err_out_unmap_bars; }memset (dev->desc_virt,0 ,sizeof (struct hifn_dma ));
Signature · 1 line
1.7.11.4
PATCH 3/4 drivers/crypto/amcc/crypto4xx_core.c: fix error return code
In reply to Peter Senna TschudinFrom: Peter Senna Tschudin <[email protected]>
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>
--- drivers/crypto/amcc/crypto4xx_core.c | 1 + 1 file changed, 1 insertion(+)
drivers/crypto/amcc/crypto4xx_core.c +1 -0
@@ -1226,6 +1226,7 @@ static int __init crypto4xx_probe(struct platform_device *ofdev) core_dev->dev->ce_base =of_iomap (ofdev->dev.of_node,0 );if (!core_dev->dev->ce_base) {dev_err (dev,"failed to of_iomap\n" ); + rc = -ENOMEM ; goto err_iomap; }
Signature · 1 line
1.7.11.4
PATCH 4/4 drivers/crypto/tegra-aes.c: fix error return code
In reply to Peter Senna TschudinFrom: Peter Senna Tschudin <[email protected]>
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>
--- drivers/crypto/tegra-aes.c | 1 + 1 file changed, 1 insertion(+)
drivers/crypto/tegra-aes.c +1 -0
@@ -969,6 +969,7 @@ static int tegra_aes_probe(struct platform_device *pdev) aes_wq =alloc_workqueue ("tegra_aes_wq" ,WQ_HIGHPRI |WQ_UNBOUND ,1 );if (!aes_wq) {dev_err (dev,"alloc_workqueue failed\n" ); + err = -ENOMEM ; goto out; }
Signature · 1 line
1.7.11.4
Quoted 25 lines · Peter Senna Tschudin
From: Peter Senna Tschudin <[email protected]>
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 = e1when != &ret*if(...)
{
... when != ret = e2
when forall
return ret;
}
// </smpl>
Quoted 1 line
Signed-off-by Peter Senna Tschudin <[email protected]>
Quoted 7 lines · Peter Senna Tschudin
From: Peter Senna Tschudin <[email protected]>
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/)
All four patches applied. Thanks.
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt