Commit 32e67b9a authored by Christophe Jaillet's avatar Christophe Jaillet Committed by Herbert Xu

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: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent b7d65fe1
...@@ -513,8 +513,10 @@ static int nitrox_probe(struct pci_dev *pdev, ...@@ -513,8 +513,10 @@ static int nitrox_probe(struct pci_dev *pdev,
pci_set_master(pdev); pci_set_master(pdev);
ndev = kzalloc(sizeof(*ndev), GFP_KERNEL); ndev = kzalloc(sizeof(*ndev), GFP_KERNEL);
if (!ndev) if (!ndev) {
err = -ENOMEM;
goto ndev_fail; goto ndev_fail;
}
pci_set_drvdata(pdev, ndev); pci_set_drvdata(pdev, ndev);
ndev->pdev = pdev; ndev->pdev = pdev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment