Message ID | 3285a03b9b3b6b6c8fa15f2bdc3a7d11386283af.1737215423.git.christophe.jaillet@wanadoo.fr (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [1/3] dmaengine: ptdma: Fix an error handling parth in pt_pci_probe() | expand |
diff --git a/drivers/dma/amd/ptdma/ptdma-pci.c b/drivers/dma/amd/ptdma/ptdma-pci.c index 7f12474bd39f..b25b6f7618c3 100644 --- a/drivers/dma/amd/ptdma/ptdma-pci.c +++ b/drivers/dma/amd/ptdma/ptdma-pci.c @@ -188,11 +188,11 @@ static int pt_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) dev_set_drvdata(dev, pt); - if (pt->dev_vdata) + if (pt->dev_vdata) { ret = pt_core_init(pt); - - if (ret) - goto e_free_irqs; + if (ret) + goto e_free_irqs; + } return 0;
'ret' can be non-zero, only if pt_core_init() was called a few lines above. So move this test inside the same "if" to make things more obvious. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> --- Compile tested only --- drivers/dma/amd/ptdma/ptdma-pci.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)