Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1712685 > unrolled thread
| Started by | Christophe JAILLET <christophe.jaillet@wanadoo.fr> |
|---|---|
| First post | 2017-08-16 07:20 +0200 |
| Last post | 2017-08-22 10:00 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] crypto: cavium/nitrox - Fix an error handling path in 'nitrox_probe()' Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2017-08-16 07:20 +0200
Re: [PATCH] crypto: cavium/nitrox - Fix an error handling path in 'nitrox_probe()' Herbert Xu <herbert@gondor.apana.org.au> - 2017-08-22 10:00 +0200
| From | Christophe JAILLET <christophe.jaillet@wanadoo.fr> |
|---|---|
| Date | 2017-08-16 07:20 +0200 |
| Subject | [PATCH] crypto: cavium/nitrox - Fix an error handling path in 'nitrox_probe()' |
| Message-ID | <ueYUh-2Ut-1@gated-at.bofh.it> |
'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>
---
drivers/crypto/cavium/nitrox/nitrox_main.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
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;
--
2.11.0
[toc] | [next] | [standalone]
| From | Herbert Xu <herbert@gondor.apana.org.au> |
|---|---|
| Date | 2017-08-22 10:00 +0200 |
| Subject | Re: [PATCH] crypto: cavium/nitrox - Fix an error handling path in 'nitrox_probe()' |
| Message-ID | <uhcgp-7KH-15@gated-at.bofh.it> |
| In reply to | #1712685 |
On Wed, Aug 16, 2017 at 07:16:06AM +0200, Christophe JAILLET wrote: > '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> Patch applied. Thanks. -- Email: Herbert Xu <herbert@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web