diff options
author | Alan Cox <alan@linux.intel.com> | 2011-07-05 15:44:34 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-07-05 08:20:44 -0700 |
commit | 6a8ca6f5ffbca4ef92da34bd28465539c511b97e (patch) | |
tree | 94b8298b4bc65791eb4239e504d7aa5c7b9a1244 /drivers | |
parent | a11c3ec7e9565bd8aad41a151b1d05c271d859e9 (diff) | |
download | lwn-6a8ca6f5ffbca4ef92da34bd28465539c511b97e.tar.gz lwn-6a8ca6f5ffbca4ef92da34bd28465539c511b97e.zip |
gma500: Fix backlight crash
We need to check the NULL case earlier.
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/gma500/backlight.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/staging/gma500/backlight.c b/drivers/staging/gma500/backlight.c index 4027e700561a..d3e698b4de61 100644 --- a/drivers/staging/gma500/backlight.c +++ b/drivers/staging/gma500/backlight.c @@ -38,9 +38,10 @@ void gma_backlight_exit(struct drm_device *dev) { #ifdef CONFIG_BACKLIGHT_CLASS_DEVICE struct drm_psb_private *dev_priv = dev->dev_private; - dev_priv->backlight_device->props.brightness = 0; - backlight_update_status(dev_priv->backlight_device); - if (dev_priv->backlight_device) + if (dev_priv->backlight_device) { + dev_priv->backlight_device->props.brightness = 0; + backlight_update_status(dev_priv->backlight_device); backlight_device_unregister(dev_priv->backlight_device); + } #endif } |