From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Subject: [PATCH 1/4] drm/fb-helper: Do not assume drm_mode_create_from_cmdline_mode() can't fail
Date: Fri, 7 Jun 2019 19:26:08 +0300 [thread overview]
Message-ID: <20190607162611.23514-1-ville.syrjala@linux.intel.com> (raw)
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
drm_mode_create_from_cmdline_mode() can return NULL, so the caller
should check for that.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/drm_fb_helper.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index b9b7c06cbc4f..bdfa14cd7f6d 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -2205,7 +2205,9 @@ struct drm_display_mode *drm_pick_cmdline_mode(struct drm_fb_helper_connector *f
create_mode:
mode = drm_mode_create_from_cmdline_mode(fb_helper_conn->connector->dev,
cmdline_mode);
- list_add(&mode->head, &fb_helper_conn->connector->modes);
+ if (mode)
+ list_add(&mode->head, &fb_helper_conn->connector->modes);
+
return mode;
}
EXPORT_SYMBOL(drm_pick_cmdline_mode);
--
2.21.0
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next reply other threads:[~2019-06-07 16:26 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-07 16:26 Ville Syrjala [this message]
2019-06-07 16:26 ` [PATCH 2/4] drm: Refuse to create zero width/height cmdline modes Ville Syrjala
2019-06-07 18:27 ` Daniel Vetter
2019-06-07 16:26 ` [PATCH 3/4] drm/fb-helper: Set up gamma_lut during restore_fbdev_mode_atomic() Ville Syrjala
2019-06-07 18:40 ` Daniel Vetter
2019-06-11 17:50 ` [Intel-gfx] " Ville Syrjälä
2019-06-11 17:55 ` Daniel Vetter
2019-06-11 18:08 ` Ville Syrjälä
2019-06-07 16:26 ` [PATCH 4/4] drm/i915: Throw away the BIOS fb if has the wrong depth/bpp Ville Syrjala
2019-06-07 18:43 ` Daniel Vetter
2019-06-11 17:51 ` Ville Syrjälä
2019-06-07 16:49 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/4] drm/fb-helper: Do not assume drm_mode_create_from_cmdline_mode() can't fail Patchwork
2019-06-07 17:53 ` ✗ Fi.CI.BAT: failure " Patchwork
2019-06-07 18:21 ` [PATCH 1/4] " Daniel Vetter
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=20190607162611.23514-1-ville.syrjala@linux.intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox