Skip to content

Commit a9d0297

Browse files
tititiou36gregkh
authored andcommitted
crypto: ccp - Fix a resource leak in an error handling path
[ Upstream commit a6f8e68 ] If an error occurs after calling 'sp_get_irqs()', 'sp_free_irqs()' must be called as already done in the error handling path. Fixes: f4d18d6 ("crypto: ccp - Abstract interrupt registeration") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Acked-by: John Allen <john.allen@amd.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent c328544 commit a9d0297

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎drivers/crypto/ccp/sp-pci.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,18 +222,20 @@ static int sp_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
222222
if (ret) {
223223
dev_err(dev, "dma_set_mask_and_coherent failed (%d)\n",
224224
ret);
225-
goto e_err;
225+
goto free_irqs;
226226
}
227227
}
228228

229229
dev_set_drvdata(dev, sp);
230230

231231
ret = sp_init(sp);
232232
if (ret)
233-
goto e_err;
233+
goto free_irqs;
234234

235235
return 0;
236236

237+
free_irqs:
238+
sp_free_irqs(sp);
237239
e_err:
238240
dev_notice(dev, "initialization failed\n");
239241
return ret;

0 commit comments

Comments
 (0)