From: Dan Carpenter <error27@gmail.com>
To: David Airlie <airlied@linux.ie>
Cc: Dave Airlie <airlied@redhat.com>,
dri-devel@lists.sourceforge.net,
Clemens Ladisch <clemens@ladisch.de>,
Jesse Barnes <jbarnes@virtuousgeek.org>
Subject: [patch -next] drm: dereferencing before checking for null
Date: Fri, 7 May 2010 10:41:00 +0200 [thread overview]
Message-ID: <20100507084100.GA27064@bicker> (raw)
The original code dereferences "fb_helper_conn" before verifying that
it's non-null.
Signed-off-by: Dan Carpenter <error27@gmail.com>
---
It's never null here actually. I could send a patch to remove the check
instead if that's prefered.
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index b28e563..f5fe3a9 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -96,11 +96,12 @@ static bool drm_fb_helper_connector_parse_command_line(struct drm_fb_helper_conn
int i;
enum drm_connector_force force = DRM_FORCE_UNSPECIFIED;
struct drm_fb_helper_cmdline_mode *cmdline_mode;
- struct drm_connector *connector = fb_helper_conn->connector;
+ struct drm_connector *connector;
if (!fb_helper_conn)
return false;
+ connector = fb_helper_conn->connector;
cmdline_mode = &fb_helper_conn->cmdline_mode;
if (!mode_option)
mode_option = fb_mode_option;
------------------------------------------------------------------------------
--
reply other threads:[~2010-05-07 8:41 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=20100507084100.GA27064@bicker \
--to=error27@gmail.com \
--cc=airlied@linux.ie \
--cc=airlied@redhat.com \
--cc=clemens@ladisch.de \
--cc=dri-devel@lists.sourceforge.net \
--cc=jbarnes@virtuousgeek.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.