[PATCH] null pointer dereference in appledisplay driver

Commit 40b20c257a by Len Brown introduced
a null pointer dereference in the appledisplay driver. This patch fixes
it.

Signed-off-by: Michael Hanselmann <linux-kernel@hansmi.ch>
Cc: Len Brown <lenb@kernel.org>
Cc: Greg KH <greg@kroah.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Michael Hanselmann 2007-02-12 00:51:34 -08:00 committed by Linus Torvalds
parent 509cb37e17
commit 2ca48ed5cc

View File

@ -281,8 +281,8 @@ static int appledisplay_probe(struct usb_interface *iface,
/* Register backlight device */
snprintf(bl_name, sizeof(bl_name), "appledisplay%d",
atomic_inc_return(&count_displays) - 1);
pdata->bd = backlight_device_register(bl_name, NULL, NULL,
&appledisplay_bl_data);
pdata->bd = backlight_device_register(bl_name, NULL,
pdata, &appledisplay_bl_data);
if (IS_ERR(pdata->bd)) {
err("appledisplay: Backlight registration failed");
goto error;