All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: agx@sigxcpu.org
Cc: dri-devel@lists.freedesktop.org
Subject: [bug report] drm/panel: Add panel driver for the Mantix MLAF057WE51-X DSI panel
Date: Mon, 31 Aug 2020 14:29:24 +0300	[thread overview]
Message-ID: <20200831112924.GA512743@mwanda> (raw)

Hello Guido Günther,

The patch 72967d5616d3: "drm/panel: Add panel driver for the Mantix
MLAF057WE51-X DSI panel" from Aug 17, 2020, leads to the following
static checker warning:

	drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c:205 mantix_get_modes()
	error: we previously assumed 'mode' could be null (see line 204)

drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c
   197  static int mantix_get_modes(struct drm_panel *panel,
   198                              struct drm_connector *connector)
   199  {
   200          struct mantix *ctx = panel_to_mantix(panel);
   201          struct drm_display_mode *mode;
   202  
   203          mode = drm_mode_duplicate(connector->dev, &default_mode);
   204          if (!mode) {
   205                  dev_err(ctx->dev, "Failed to add mode %ux%u@%u\n",
   206                          default_mode.hdisplay, default_mode.vdisplay,
   207                          drm_mode_vrefresh(mode));
                                                  ^^^^
This will lead to a NULL dereference.

   208                  return -ENOMEM;
   209          }
   210  
   211          drm_mode_set_name(mode);
   212  
   213          mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
   214          connector->display_info.width_mm = mode->width_mm;
   215          connector->display_info.height_mm = mode->height_mm;
   216          drm_mode_probed_add(connector, mode);
   217  
   218          return 1;
   219  }

regards,
dan carpenter
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

             reply	other threads:[~2020-08-31 11:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-31 11:29 Dan Carpenter [this message]
2020-09-04  7:47 ` [bug report] drm/panel: Add panel driver for the Mantix MLAF057WE51-X DSI panel Guido Günther

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=20200831112924.GA512743@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=agx@sigxcpu.org \
    --cc=dri-devel@lists.freedesktop.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.