> Fix iob_pdev reference leak in pasemi_dma_init() when dma_pdev
> allocation fails. Ensure pci_dev_put(iob_pdev) is called on
> both success and error paths.

How do you think about to increase the application of scope-based resource 
management?


…
> +++ b/arch/powerpc/platforms/pasemi/dma_lib.c
> @@ -530,7 +530,7 @@ int pasemi_dma_init(void)
>               BUG();
>               pr_warn("Can't find DMA controller\n");
>               err = -ENODEV;
> -             goto out;

Is it sufficient to add the function call “pci_dev_put(iob_pdev)”
in this if branch?


> +             goto out_put_iob;
>       }
>       dma_regs = map_onedev(dma_pdev, 0);
…

Regards,
Markus

Reply via email to