Commit cc92ac20 authored by Jiri Slaby's avatar Jiri Slaby Committed by Greg Kroah-Hartman

Staging: lirc, fix NULL dereference

When 'context' allocation fails in imon_probe, we jump to unlock
context->ctx_lock. This is wrong as context is NULL and the lock is
not locked.

Fix the labels.
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
Cc: Jarod Wilson <jarod@redhat.com>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 54669fde
...@@ -873,7 +873,7 @@ static int imon_probe(struct usb_interface *interface, ...@@ -873,7 +873,7 @@ static int imon_probe(struct usb_interface *interface,
if (lirc_minor < 0) { if (lirc_minor < 0) {
err("%s: lirc_register_driver failed", __func__); err("%s: lirc_register_driver failed", __func__);
alloc_status = 7; alloc_status = 7;
goto alloc_status_switch; goto unlock;
} else } else
dev_info(dev, "Registered iMON driver " dev_info(dev, "Registered iMON driver "
"(lirc minor: %d)\n", lirc_minor); "(lirc minor: %d)\n", lirc_minor);
...@@ -929,8 +929,9 @@ static int imon_probe(struct usb_interface *interface, ...@@ -929,8 +929,9 @@ static int imon_probe(struct usb_interface *interface,
"usb<%d:%d> initialized\n", vendor, product, ifnum, "usb<%d:%d> initialized\n", vendor, product, ifnum,
usbdev->bus->busnum, usbdev->devnum); usbdev->bus->busnum, usbdev->devnum);
alloc_status_switch: unlock:
mutex_unlock(&context->ctx_lock); mutex_unlock(&context->ctx_lock);
alloc_status_switch:
switch (alloc_status) { switch (alloc_status) {
case 7: case 7:
......
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