From: SF Markus Elfring <elfring@users.sourceforge.net>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Jammy Zhou <Jammy.Zhou@amd.com>,
kernel-janitors@vger.kernel.org, dri-devel@lists.freedesktop.org,
Julia Lawall <julia.lawall@lip6.fr>,
Alex Deucher <alexander.deucher@amd.com>,
Rex Zhu <Rex.Zhu@amd.com>
Subject: Re: [patch] drm/amd/powerplay: fix a reversed condition
Date: Tue, 05 Jan 2016 09:06:58 +0000 [thread overview]
Message-ID: <568B87B2.5010105@users.sourceforge.net> (raw)
In-Reply-To: <20160104204255.GB19867@mwanda>
> This test was reversed so it would end up leading to a NULL dereference.
>
> Fixes: 4630f0faae80 ('drm/amd/powerplay: add Carrizo smu support')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c
> index e74023b..873a8d2 100644
> --- a/drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c
> @@ -818,7 +818,7 @@ static int cz_smu_fini(struct pp_smumgr *smumgr)
> return -EINVAL;
>
> cz_smu = (struct cz_smumgr *)smumgr->backend;
> - if (!cz_smu) {
> + if (cz_smu) {
> cgs_free_gpu_mem(smumgr->device,
> cz_smu->toc_buffer.handle);
> cgs_free_gpu_mem(smumgr->device,
Was this issue found by an automatic static source code analysis of a tool
like "Smatch"?
https://blogs.oracle.com/linuxkernel/entry/smatch_static_analysis_tool_overview
http://smatch.sourceforge.net/
Would it be useful to detect similar update candidates by the reuse of scripts
for the semantic patch language?
How do you think about to get additional help and support from a software
like Coccinelle for such search patterns?
Regards,
Markus
WARNING: multiple messages have this Message-ID (diff)
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Jammy Zhou <Jammy.Zhou@amd.com>,
kernel-janitors@vger.kernel.org, dri-devel@lists.freedesktop.org,
Julia Lawall <julia.lawall@lip6.fr>,
Alex Deucher <alexander.deucher@amd.com>,
Rex Zhu <Rex.Zhu@amd.com>
Subject: Re: [patch] drm/amd/powerplay: fix a reversed condition
Date: Tue, 5 Jan 2016 10:06:58 +0100 [thread overview]
Message-ID: <568B87B2.5010105@users.sourceforge.net> (raw)
In-Reply-To: <20160104204255.GB19867@mwanda>
> This test was reversed so it would end up leading to a NULL dereference.
>
> Fixes: 4630f0faae80 ('drm/amd/powerplay: add Carrizo smu support')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c
> index e74023b..873a8d2 100644
> --- a/drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c
> @@ -818,7 +818,7 @@ static int cz_smu_fini(struct pp_smumgr *smumgr)
> return -EINVAL;
>
> cz_smu = (struct cz_smumgr *)smumgr->backend;
> - if (!cz_smu) {
> + if (cz_smu) {
> cgs_free_gpu_mem(smumgr->device,
> cz_smu->toc_buffer.handle);
> cgs_free_gpu_mem(smumgr->device,
Was this issue found by an automatic static source code analysis of a tool
like "Smatch"?
https://blogs.oracle.com/linuxkernel/entry/smatch_static_analysis_tool_overview
http://smatch.sourceforge.net/
Would it be useful to detect similar update candidates by the reuse of scripts
for the semantic patch language?
How do you think about to get additional help and support from a software
like Coccinelle for such search patterns?
Regards,
Markus
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2016-01-05 9:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-04 20:42 [patch] drm/amd/powerplay: fix a reversed condition Dan Carpenter
2016-01-04 20:42 ` Dan Carpenter
2016-01-04 21:17 ` Alex Deucher
2016-01-04 21:17 ` Alex Deucher
2016-01-05 9:06 ` SF Markus Elfring [this message]
2016-01-05 9:06 ` SF Markus Elfring
2016-01-05 11:14 ` Dan Carpenter
2016-01-05 11:14 ` Dan Carpenter
2016-01-05 12:36 ` SF Markus Elfring
2016-01-05 12:36 ` SF Markus Elfring
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=568B87B2.5010105@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=Jammy.Zhou@amd.com \
--cc=Rex.Zhu@amd.com \
--cc=alexander.deucher@amd.com \
--cc=dan.carpenter@oracle.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=julia.lawall@lip6.fr \
--cc=kernel-janitors@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.