lkml.org 
[lkml]   [2019]   [Apr]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/3] net: xilinx: fix possible object reference leak
From
Date
> @@ -1575,12 +1575,14 @@  static int axienet_probe(struct platform_device *pdev)
> ret = of_address_to_resource(np, 0, &dmares);
> if (ret) {
> dev_err(&pdev->dev, "unable to get DMA resource\n");
> + of_node_put(np);
> goto free_netdev;
> }
> lp->dma_regs = devm_ioremap_resource(&pdev->dev, &dmares);
> if (IS_ERR(lp->dma_regs)) {
> dev_err(&pdev->dev, "could not map DMA regs\n");
> ret = PTR_ERR(lp->dma_regs);
> + of_node_put(np);
> goto free_netdev;
> }

How do you think about to move these put calls to an additional
jump target for the desired exception handling?

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/net/ethernet/xilinx/xilinx_axienet_main.c?id=fa3a419d2f674b431d38748cb58fb7da17ee8949#n1621

Regards,
Markus

\
 
 \ /
  Last update: 2019-04-05 09:56    [W:0.074 / U:6.644 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site