gma500: Re-order checks and dereferences in psb_intel_lvds
commitd3cf695c58eae98271effac22e6dce00bb61cd06
authorAlan Cox <alan@linux.intel.com>
Fri, 8 Jul 2011 08:43:15 +0000 (8 09:43 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 8 Jul 2011 20:44:56 +0000 (8 13:44 -0700)
tree453c601d6a09e6ed52f4fa525d31b5048d43c2c7
parentfa3b1c881247752677cec042dd4d82a9dde1bf88
gma500: Re-order checks and dereferences in psb_intel_lvds

Dan Carpenter reports:

Smatch complains about 6a7afe3acc4b "gma500: continue abstracting
platform specific code"

drivers/staging/gma500/psb_intel_lvds.c +579 psb_intel_lvds_set_property(7)
warn: variable dereferenced before check 'encoder'

--- a/drivers/staging/gma500/psb_intel_lvds.c
+++ b/drivers/staging/gma500/psb_intel_lvds.c
@@ -575,11 +575,12 @@ int psb_intel_lvds_set_property(struct drm_connector *connector,
       struct drm_property *property,
       uint64_t value)
 {
-       struct drm_encoder *pEncoder = connector->encoder;
+       struct drm_encoder *encoder = connector->encoder;
+       struct drm_psb_private *dev_priv = encoder->dev->dev_private;
   ^^^^^^^^^^^^
dereference encoder here.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/gma500/psb_intel_lvds.c