linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Wen Yang <wen.yang99@zte.com.cn>, Eric Anholt <eric@anholt.net>,
	dri-devel@lists.freedesktop.org, kernel-janitors@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Daniel Vetter <daniel@ffwll.ch>,
	David Airlie <airlied@linux.ie>, Yi Wang <wang.yi59@zte.com.cn>
Subject: Re: [PATCH 5/7] drm/pl111: fix possible object reference leak
Date: Thu, 4 Apr 2019 23:05:03 +0200	[thread overview]
Message-ID: <439634be-1704-703f-f975-98909b950224@web.de> (raw)
In-Reply-To: <1554307455-40361-6-git-send-email-wen.yang99@zte.com.cn>

> @@ -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

  parent reply	other threads:[~2019-04-04 21:05 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-03 16:04 [PATCH 0/7] fix possible object reference leaks in drivers/gpu Wen Yang
2019-04-03 16:04 ` [PATCH 1/7] drm/mediatek: fix possible object reference leak Wen Yang
2019-04-09  5:15   ` CK Hu
2019-04-03 16:04 ` [PATCH 2/7] drm/meson: " Wen Yang
2019-04-04 20:05   ` Markus Elfring
2019-04-03 16:04 ` [PATCH 3/7] drm/msm: a5xx: " Wen Yang
2019-04-10 16:21   ` Jordan Crouse
2019-04-03 16:04 ` [PATCH 4/7] drm/omap: " Wen Yang
2019-04-04 13:25   ` Laurent Pinchart
2019-04-04 20:42   ` Markus Elfring
2019-04-03 16:04 ` [PATCH 5/7] drm/pl111: " Wen Yang
2019-04-04 19:59   ` Eric Anholt
2019-04-04 21:05   ` Markus Elfring [this message]
2019-04-03 16:04 ` [PATCH 6/7] drm: rcar-du: " Wen Yang
2019-04-04 13:35   ` Laurent Pinchart
2019-04-03 16:04 ` [PATCH 7/7] drm/tegra: " Wen Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=439634be-1704-703f-f975-98909b950224@web.de \
    --to=markus.elfring@web.de \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=eric@anholt.net \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wang.yi59@zte.com.cn \
    --cc=wen.yang99@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).