fore200e_pca_detect() enables the PCI device before setting the DMA mask. If dma_set_mask_and_coherent() fails, the current error path returns without disabling the device. Reuse the existing out_disable unwind label for this failure path so pci_disable_device() is called after a successful pci_enable_device(). Fixes: ede58ef28e10 ("atm: remove deprecated use of pci api") Co-developed-by: Ijae Kim Signed-off-by: Ijae Kim Signed-off-by: Myeonghun Pak --- drivers/atm/fore200e.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c index 2423eed506..5e2cc4813e 100644 --- a/drivers/atm/fore200e.c +++ b/drivers/atm/fore200e.c @@ -2593,7 +2593,7 @@ static int fore200e_pca_detect(struct pci_dev *pci_dev, if (dma_set_mask_and_coherent(&pci_dev->dev, DMA_BIT_MASK(32))) { err = -EINVAL; - goto out; + goto out_disable; } fore200e = kzalloc_obj(struct fore200e); -- 2.47.1