From: Bartosz Golaszewski Date: Fri, 21 Sep 2018 13:40:09 +0000 (-0700) Subject: nvmem: sunxi_sid: return -ENOMEM if kzalloc() fails X-Git-Tag: v5.15~7734^2~87 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=424d7033add17ce897305242901e14df1ff90195;p=platform%2Fkernel%2Flinux-starfive.git nvmem: sunxi_sid: return -ENOMEM if kzalloc() fails The driver currently returns -EINVAL if kzalloc() fails in probe(). Change it to -ENOMEM as it should be. Signed-off-by: Bartosz Golaszewski Signed-off-by: Srinivas Kandagatla Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/nvmem/sunxi_sid.c b/drivers/nvmem/sunxi_sid.c index d020f89..4d0b7e7 100644 --- a/drivers/nvmem/sunxi_sid.c +++ b/drivers/nvmem/sunxi_sid.c @@ -187,7 +187,7 @@ static int sunxi_sid_probe(struct platform_device *pdev) randomness = kzalloc(size, GFP_KERNEL); if (!randomness) { - ret = -EINVAL; + ret = -ENOMEM; goto err_unreg_nvmem; }