From: Mark yao <mark.yao@rock-chips.com>
To: "Gustavo A. R. Silva" <garsilva@embeddedor.com>,
David Airlie <airlied@linux.ie>, Heiko Stuebner <heiko@sntech.de>
Cc: dri-devel@lists.freedesktop.org,
linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/rockchip: fix NULL check on devm_kzalloc() return value
Date: Fri, 7 Jul 2017 08:56:28 +0800 [thread overview]
Message-ID: <595EDC3C.1010801@rock-chips.com> (raw)
In-Reply-To: <20170706215833.GA25411@embeddedgus>
On 2017年07月07日 05:58, Gustavo A. R. Silva wrote:
> The right variable to check here is port, not dp.
>
> This issue was detected using Coccinelle and the following semantic patch:
>
> @@
> expression x;
> identifier fld;
> @@
>
> * x = devm_kzalloc(...);
> ... when != x == NULL
> x->fld
>
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Thanks for the fix,
Acked-by: Mark Yao <mark.yao@rock-chips.com>
> ---
> drivers/gpu/drm/rockchip/cdn-dp-core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c
> index 14fa1f8..9b0b058 100644
> --- a/drivers/gpu/drm/rockchip/cdn-dp-core.c
> +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c
> @@ -1195,7 +1195,7 @@ static int cdn_dp_probe(struct platform_device *pdev)
> continue;
>
> port = devm_kzalloc(dev, sizeof(*port), GFP_KERNEL);
> - if (!dp)
> + if (!port)
> return -ENOMEM;
>
> port->extcon = extcon;
--
Mark Yao
next prev parent reply other threads:[~2017-07-07 0:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-06 21:58 [PATCH] drm/rockchip: fix NULL check on devm_kzalloc() return value Gustavo A. R. Silva
2017-07-07 0:56 ` Mark yao [this message]
2017-07-10 19:04 ` Sean Paul
2017-07-11 0:44 ` Mark yao
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=595EDC3C.1010801@rock-chips.com \
--to=mark.yao@rock-chips.com \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
--cc=garsilva@embeddedor.com \
--cc=heiko@sntech.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
/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