Skip to content

Commit

Permalink
gma500: Fix backlight crash
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alan Cox authored and Greg Kroah-Hartman committed Jul 5, 2011
1 parent a11c3ec commit 6a8ca6f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/staging/gma500/backlight.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 6a8ca6f

Please sign in to comment.