From: Jocelyn Falempe <jfalempe@redhat.com>
To: Thomas Zimmermann <tzimmermann@suse.de>,
dri-devel@lists.freedesktop.org,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>
Subject: Re: [PATCH] drm/fb_dma: Add checks in drm_fb_dma_get_scanout_buffer()
Date: Tue, 30 Apr 2024 16:29:33 +0200 [thread overview]
Message-ID: <5f05f009-e403-4762-b836-7302f00665e2@redhat.com> (raw)
In-Reply-To: <fdcf1ede-866d-4720-9dc1-ee729ace62a2@suse.de>
On 29/04/2024 09:24, Thomas Zimmermann wrote:
>
>
> Am 26.04.24 um 14:10 schrieb Jocelyn Falempe:
>> plane->state and plane->state->fb can be NULL, so add a check before
>> dereferencing them.
>> Found by testing with the imx driver.
>>
>> Fixes: 879b3b6511fe9 ("drm/fb_dma: Add generic get_scanout_buffer()
>> for drm_panic")
>> Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
>> ---
>> drivers/gpu/drm/drm_fb_dma_helper.c | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/drm_fb_dma_helper.c
>> b/drivers/gpu/drm/drm_fb_dma_helper.c
>> index 96e5ab960f12..d7bffde94cc5 100644
>> --- a/drivers/gpu/drm/drm_fb_dma_helper.c
>> +++ b/drivers/gpu/drm/drm_fb_dma_helper.c
>> @@ -167,6 +167,9 @@ int drm_fb_dma_get_scanout_buffer(struct drm_plane
>> *plane,
>> struct drm_gem_dma_object *dma_obj;
>> struct drm_framebuffer *fb;
>> + if (!plane->state || !plane->state->fb)
>> + return -ENODEV;
>> +
>
> It's EINVAL here. With that fixed, free free to add
Thanks, I just merged it to drm-misc-next with that fixed.
>
> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
>
> Best regards
> Thomas
>
>> fb = plane->state->fb;
>> /* Only support linear modifier */
>> if (fb->modifier != DRM_FORMAT_MOD_LINEAR)
>>
>> base-commit: 2e3f08a1ac99cb9a19a5cb151593d4f9df5cc6a7
>
--
Jocelyn
prev parent reply other threads:[~2024-04-30 14:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-26 12:10 [PATCH] drm/fb_dma: Add checks in drm_fb_dma_get_scanout_buffer() Jocelyn Falempe
2024-04-29 7:24 ` Thomas Zimmermann
2024-04-30 14:29 ` Jocelyn Falempe [this message]
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=5f05f009-e403-4762-b836-7302f00665e2@redhat.com \
--to=jfalempe@redhat.com \
--cc=airlied@gmail.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=tzimmermann@suse.de \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).