summaryrefslogtreecommitdiff
path: root/drivers/crypto
diff options
context:
space:
mode:
authorChristophe Jaillet <christophe.jaillet@wanadoo.fr>2017-08-16 08:16:06 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2017-08-22 09:54:55 +0300
commit32e67b9af077e905388f1746bf429ea0c39b6917 (patch)
tree5c62e6556aa684e94d7f05ff193be8e956436681 /drivers/crypto
parentb7d65fe18129e2f557c31126fe6623e8c2731528 (diff)
downloadlinux-32e67b9af077e905388f1746bf429ea0c39b6917.tar.xz
crypto: cavium/nitrox - Fix an error handling path in 'nitrox_probe()'
'err' is known to be 0 at this point. If 'kzalloc()' fails, returns -ENOMEM instead of 0 which means success. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rw-r--r--drivers/crypto/cavium/nitrox/nitrox_main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/crypto/cavium/nitrox/nitrox_main.c b/drivers/crypto/cavium/nitrox/nitrox_main.c
index 9ccefb9b7232..fee7cb2ce747 100644
--- a/drivers/crypto/cavium/nitrox/nitrox_main.c
+++ b/drivers/crypto/cavium/nitrox/nitrox_main.c
@@ -513,8 +513,10 @@ static int nitrox_probe(struct pci_dev *pdev,
pci_set_master(pdev);
ndev = kzalloc(sizeof(*ndev), GFP_KERNEL);
- if (!ndev)
+ if (!ndev) {
+ err = -ENOMEM;
goto ndev_fail;
+ }
pci_set_drvdata(pdev, ndev);
ndev->pdev = pdev;