Skip to content

Commit

Permalink
crypto: crypto4xx - fix an error code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christophe Jaillet authored and Herbert Xu committed Jun 20, 2017
1 parent 88d58ef commit ffe5526
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/crypto/amcc/crypto4xx_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit ffe5526

Please sign in to comment.