nvmem: sunxi_sid: return -ENOMEM if kzalloc() fails
authorBartosz Golaszewski <bgolaszewski@baylibre.com>
Fri, 21 Sep 2018 13:40:09 +0000 (06:40 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 28 Sep 2018 13:14:54 +0000 (15:14 +0200)
The driver currently returns -EINVAL if kzalloc() fails in probe().
Change it to -ENOMEM as it should be.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nvmem/sunxi_sid.c

index d020f89248fd76a7baca320bb6a4238a71d785c0..4d0b7e72aa2eb4dcf99c4dbbb82109584f67996b 100644 (file)
@@ -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;
        }