Commit 6a8ca6f5 authored by Alan Cox's avatar Alan Cox Committed by Greg Kroah-Hartman

gma500: Fix backlight crash

We need to check the NULL case earlier.
Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent a11c3ec7
...@@ -38,9 +38,10 @@ void gma_backlight_exit(struct drm_device *dev) ...@@ -38,9 +38,10 @@ void gma_backlight_exit(struct drm_device *dev)
{ {
#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE #ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
struct drm_psb_private *dev_priv = dev->dev_private; struct drm_psb_private *dev_priv = dev->dev_private;
dev_priv->backlight_device->props.brightness = 0; if (dev_priv->backlight_device) {
backlight_update_status(dev_priv->backlight_device); dev_priv->backlight_device->props.brightness = 0;
if (dev_priv->backlight_device) backlight_update_status(dev_priv->backlight_device);
backlight_device_unregister(dev_priv->backlight_device); backlight_device_unregister(dev_priv->backlight_device);
}
#endif #endif
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment