From: Kevin Tang <kevin3.tang@gmail.com> To: maarten.lankhorst@linux.intel.com, mripard@kernel.org, airlied@linux.ie, daniel@ffwll.ch, mark.rutland@arm.com, javierm@redhat.com, tzimmermann@suse.de, lukas.bulwahn@gmail.com Cc: zou_wei@huawei.com, kevin3.tang@gmail.com, pony1.wu@gmail.com, orsonzhai@gmail.com, dan.carpenter@oracle.com, zhang.lyra@gmail.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Subject: [PATCH v2 2/3] drm/sprd: fix potential NULL dereference Date: Mon, 17 Jan 2022 16:40:44 +0800 [thread overview] Message-ID: <20220117084044.9210-1-kevin3.tang@gmail.com> (raw) 'drm' could be null in sprd_drm_shutdown, and drm_warn maybe dereference it, remove this warning log. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Kevin Tang <kevin.tang@unisoc.com> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Acked-by: Thomas Zimmermann <tzimmermann@suse.de> v1 -> v2: - Split checking platform_get_resource() return value to a separate patch - Use dev_warn() instead of removing the warning log --- drivers/gpu/drm/sprd/sprd_drm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/sprd/sprd_drm.c b/drivers/gpu/drm/sprd/sprd_drm.c index a077e2d4d..af2be97d5 100644 --- a/drivers/gpu/drm/sprd/sprd_drm.c +++ b/drivers/gpu/drm/sprd/sprd_drm.c @@ -155,7 +155,7 @@ static void sprd_drm_shutdown(struct platform_device *pdev) struct drm_device *drm = platform_get_drvdata(pdev); if (!drm) { - drm_warn(drm, "drm device is not available, no shutdown\n"); + dev_warn(&pdev->dev, "drm device is not available, no shutdown\n"); return; } -- 2.29.0
WARNING: multiple messages have this Message-ID (diff)
From: Kevin Tang <kevin3.tang@gmail.com> To: maarten.lankhorst@linux.intel.com, mripard@kernel.org, airlied@linux.ie, daniel@ffwll.ch, mark.rutland@arm.com, javierm@redhat.com, tzimmermann@suse.de, lukas.bulwahn@gmail.com Cc: devicetree@vger.kernel.org, kevin3.tang@gmail.com, zhang.lyra@gmail.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, orsonzhai@gmail.com, zou_wei@huawei.com, pony1.wu@gmail.com, dan.carpenter@oracle.com Subject: [PATCH v2 2/3] drm/sprd: fix potential NULL dereference Date: Mon, 17 Jan 2022 16:40:44 +0800 [thread overview] Message-ID: <20220117084044.9210-1-kevin3.tang@gmail.com> (raw) 'drm' could be null in sprd_drm_shutdown, and drm_warn maybe dereference it, remove this warning log. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Kevin Tang <kevin.tang@unisoc.com> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Acked-by: Thomas Zimmermann <tzimmermann@suse.de> v1 -> v2: - Split checking platform_get_resource() return value to a separate patch - Use dev_warn() instead of removing the warning log --- drivers/gpu/drm/sprd/sprd_drm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/sprd/sprd_drm.c b/drivers/gpu/drm/sprd/sprd_drm.c index a077e2d4d..af2be97d5 100644 --- a/drivers/gpu/drm/sprd/sprd_drm.c +++ b/drivers/gpu/drm/sprd/sprd_drm.c @@ -155,7 +155,7 @@ static void sprd_drm_shutdown(struct platform_device *pdev) struct drm_device *drm = platform_get_drvdata(pdev); if (!drm) { - drm_warn(drm, "drm device is not available, no shutdown\n"); + dev_warn(&pdev->dev, "drm device is not available, no shutdown\n"); return; } -- 2.29.0
next reply other threads:[~2022-01-17 8:41 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-01-17 8:40 Kevin Tang [this message] 2022-01-17 8:40 ` [PATCH v2 2/3] drm/sprd: fix potential NULL dereference Kevin Tang
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=20220117084044.9210-1-kevin3.tang@gmail.com \ --to=kevin3.tang@gmail.com \ --cc=airlied@linux.ie \ --cc=dan.carpenter@oracle.com \ --cc=daniel@ffwll.ch \ --cc=devicetree@vger.kernel.org \ --cc=dri-devel@lists.freedesktop.org \ --cc=javierm@redhat.com \ --cc=linux-kernel@vger.kernel.org \ --cc=lukas.bulwahn@gmail.com \ --cc=maarten.lankhorst@linux.intel.com \ --cc=mark.rutland@arm.com \ --cc=mripard@kernel.org \ --cc=orsonzhai@gmail.com \ --cc=pony1.wu@gmail.com \ --cc=tzimmermann@suse.de \ --cc=zhang.lyra@gmail.com \ --cc=zou_wei@huawei.com \ /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: linkBe 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.