crypto: crypto4xx - fix an error code
authorChristophe Jaillet <christophe.jaillet@wanadoo.fr>
Sat, 10 Jun 2017 12:54:33 +0000 (14:54 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 20 Jun 2017 03:21:14 +0000 (11:21 +0800)
If 'kzalloc' fails, we return 0 which means success.
return -ENOMEM instead as already done a few lines above.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/amcc/crypto4xx_core.c

index fdc83a2281ca76cdd0b4ea597eb8bfc6e2998c10..65dc78b91dea0147e454a5f9fdb20ed4bf024510 100644 (file)
@@ -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;