dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Thomas Zimmermann <tzimmermann@suse.de>
Cc: dri-devel@lists.freedesktop.org
Subject: [bug report] drm/sysfb: Add custom plane state
Date: Fri, 17 Oct 2025 11:49:06 +0300	[thread overview]
Message-ID: <aPIDAsHIUHp_qSW4@stanley.mountain> (raw)

Hello Thomas Zimmermann,

Commit e45f72b6782f ("drm/sysfb: Add custom plane state") from Sep
18, 2025 (linux-next), leads to the following Smatch static checker
warning:

	drivers/gpu/drm/sysfb/drm_sysfb_modeset.c:434 drm_sysfb_plane_reset()
	error: NULL dereference inside function __drm_gem_reset_shadow_plane()

drivers/gpu/drm/sysfb/drm_sysfb_modeset.c
    424 {
    425         struct drm_sysfb_plane_state *sysfb_plane_state;
    426 
    427         if (plane->state)
    428                 drm_sysfb_plane_state_destroy(to_drm_sysfb_plane_state(plane->state));
    429 
    430         sysfb_plane_state = kzalloc(sizeof(*sysfb_plane_state), GFP_KERNEL);
    431         if (sysfb_plane_state)
    432                 __drm_gem_reset_shadow_plane(plane, &sysfb_plane_state->base);
    433         else
--> 434                 __drm_gem_reset_shadow_plane(plane, NULL);
                                                            ^^^^
Passing a NULL here will crash.  (It's the second line where we call
drm_format_conv_state_init() that's the problem).

    435 }

regards,
dan carpenter

                 reply	other threads:[~2025-10-17  8:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=aPIDAsHIUHp_qSW4@stanley.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=dri-devel@lists.freedesktop.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