[PATCH 5/7] drm/pl111: fix possible object reference leak

Markus Elfring Markus.Elfring at web.de
Thu Apr 4 21:05:03 UTC 2019


> @@ -337,17 +338,20 @@ int pl111_versatile_init(struct device *dev, struct pl111_drm_dev_private *priv)
>  		pdev = of_find_device_by_node(np);
>  		if (!pdev) {
>  			dev_err(dev, "can't find the sysreg device, deferring\n");
> +			of_node_put(np);
>  			return -EPROBE_DEFER;
>  		}
>  		map = dev_get_drvdata(&pdev->dev);
>  		if (!map) {
>  			dev_err(dev, "sysreg has not yet probed\n");
>  			platform_device_put(pdev);
> +			of_node_put(np);
>  			return -EPROBE_DEFER;
>  		}

How do you think about to move duplicate statements to an additional
jump target for the desired exception handling?

Regards,
Markus


More information about the dri-devel mailing list