From: Christophe Jaillet Date: Sat, 10 Jun 2017 12:54:33 +0000 (+0200) Subject: crypto: crypto4xx - fix an error code X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=ffe55266e36bef40b940b38bfef4fcff4957624d;p=openwrt%2Fstaging%2Fblogic.git crypto: crypto4xx - fix an error code If 'kzalloc' fails, we return 0 which means success. return -ENOMEM instead as already done a few lines above. Signed-off-by: Christophe JAILLET Signed-off-by: Herbert Xu --- diff --git a/drivers/crypto/amcc/crypto4xx_core.c b/drivers/crypto/amcc/crypto4xx_core.c index fdc83a2281ca..65dc78b91dea 100644 --- a/drivers/crypto/amcc/crypto4xx_core.c +++ b/drivers/crypto/amcc/crypto4xx_core.c @@ -1179,6 +1179,7 @@ static int crypto4xx_probe(struct platform_device *ofdev) dev_set_drvdata(dev, core_dev); core_dev->ofdev = ofdev; core_dev->dev = kzalloc(sizeof(struct crypto4xx_device), GFP_KERNEL); + rc = -ENOMEM; if (!core_dev->dev) goto err_alloc_dev;