[PATCH] nvmem: delete unneeded IS_ERR test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



devm_kzalloc returns NULL rather than an ERR_PTR value.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x,e;
@@

* x = devm_kzalloc(...)
... when != x = e
* IS_ERR(x)
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@xxxxxxx>

---
 drivers/nvmem/rockchip-efuse.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/nvmem/rockchip-efuse.c b/drivers/nvmem/rockchip-efuse.c
index f552134..811c73c 100644
--- a/drivers/nvmem/rockchip-efuse.c
+++ b/drivers/nvmem/rockchip-efuse.c
@@ -136,8 +136,8 @@ static int rockchip_efuse_probe(struct platform_device *pdev)
 
 	context = devm_kzalloc(dev, sizeof(struct rockchip_efuse_context),
 			       GFP_KERNEL);
-	if (IS_ERR(context))
-		return PTR_ERR(context);
+	if (!context)
+		return -ENOMEM;
 
 	clk = devm_clk_get(dev, "pclk_efuse");
 	if (IS_ERR(clk))

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux