aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2010-09-04 14:32:25 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2010-09-04 21:26:05 -0700
commitcc92ac20496fa24209712ab561738f4f8b57336a (patch)
tree8766429b8fa9f0a97180a9382d2799948e0a0136
parent54669fdeb24b129cfa6f188796430be79ebc8688 (diff)
downloadmrst-s0i3-test-cc92ac20496fa24209712ab561738f4f8b57336a.tar.gz
mrst-s0i3-test-cc92ac20496fa24209712ab561738f4f8b57336a.tar.xz
mrst-s0i3-test-cc92ac20496fa24209712ab561738f4f8b57336a.zip
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: Jiri Slaby <jslaby@suse.cz> Cc: Jarod Wilson <jarod@redhat.com> Cc: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/staging/lirc/lirc_imon.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/staging/lirc/lirc_imon.c b/drivers/staging/lirc/lirc_imon.c
index 818bec0bb91..2661718b964 100644
--- a/drivers/staging/lirc/lirc_imon.c
+++ b/drivers/staging/lirc/lirc_imon.c
@@ -873,7 +873,7 @@ static int imon_probe(struct usb_interface *interface,
if (lirc_minor < 0) {
err("%s: lirc_register_driver failed", __func__);
alloc_status = 7;
- goto alloc_status_switch;
+ goto unlock;
} else
dev_info(dev, "Registered iMON driver "
"(lirc minor: %d)\n", lirc_minor);
@@ -929,8 +929,9 @@ static int imon_probe(struct usb_interface *interface,
"usb<%d:%d> initialized\n", vendor, product, ifnum,
usbdev->bus->busnum, usbdev->devnum);
-alloc_status_switch:
+unlock:
mutex_unlock(&context->ctx_lock);
+alloc_status_switch:
switch (alloc_status) {
case 7: