From: Emil Velikov <emil.l.velikov@gmail.com>
To: Meng Yi <meng.yi@nxp.com>
Cc: ML dri-devel <dri-devel@lists.freedesktop.org>
Subject: Re: [RESEND,V2] drm: fsl-dcu: Fix no fb check bug
Date: Tue, 26 Jan 2016 21:18:05 +0000 [thread overview]
Message-ID: <CACvgo52ZmaXhAgUPkgn2+EVB8G0GLxr7PMewsc8PsNxdFmjfyQ@mail.gmail.com> (raw)
In-Reply-To: <HE1PR04MB10510D2739ADB183FE7C00B4ECCC0@HE1PR04MB1051.eurprd04.prod.outlook.com>
On 14 January 2016 at 08:23, Meng Yi <meng.yi@nxp.com> wrote:
>> >> switch (fb->pixel_format) {
>> >> case DRM_FORMAT_RGB565:
>> >> case DRM_FORMAT_RGB888:
>> >> @@ -85,9 +88,6 @@ static void fsl_dcu_drm_plane_atomic_update(struct
>> drm_plane *plane,
>> >> unsigned int alpha, bpp;
>> >> int index, ret;
>> >>
>> >> - if (!fb)
>> >> - return;
>> >> -
>> > ... which no longer has the !fb check, and we'll crash with null deref
>> > a few lines below ?
>>
>>
>> If there is a legitimate situation where fb is null which also ultimately leads to a
>> atomic_commit, I guess we should keep the return here...
>
> I think I made a mistake here, fb check should not be removed . As Stefan mentioned, if fb check in fsl_dcu_drm_plane_atomic_check return 0, fsl_dcu_drm_plane_atomic_update will ultimately called, and we'll crash since plane->state->fb is NULL.
>
I believe you meant "Emil" in the above ;-) But seriously... afaict a
fair few drivers do a similar !fb (even !state->crtc) check(s)...
which makes me wonder if core DRM isn't the better place for it ? Or
perhaps that's intentional as core provides the flexibility for each
driver to mangle with the fb between .check and .disable ?
Cheers
Emil
P.S. Please don't top post, use interleaved style [1]
[1] https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
_______________________________________________
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-26 21:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-06 4:12 [RESEND,V2] drm: fsl-dcu: Fix no fb check bug Meng Yi
2016-01-08 9:20 ` Emil Velikov
2016-01-14 5:54 ` Stefan Agner
2016-01-14 8:23 ` Meng Yi
2016-01-26 21:18 ` Emil Velikov [this message]
2016-01-28 2:23 ` Stefan Agner
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=CACvgo52ZmaXhAgUPkgn2+EVB8G0GLxr7PMewsc8PsNxdFmjfyQ@mail.gmail.com \
--to=emil.l.velikov@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=meng.yi@nxp.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: 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).