* [patch -next] drm: dereferencing before checking for null
@ 2010-05-07 8:41 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2010-05-07 8:41 UTC (permalink / raw)
To: David Airlie; +Cc: Dave Airlie, dri-devel, Clemens Ladisch, Jesse Barnes
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;
------------------------------------------------------------------------------
--
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2010-05-07 8:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-07 8:41 [patch -next] drm: dereferencing before checking for null Dan Carpenter
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.