PROBLEM: bug at ./drivers/media/video/hdpvr/hdpvr-core.c

From: iceberg
Date: Fri Jul 03 2009 - 07:16:55 EST


KERNEL_V ERSION: 2.6.30
SUBJECT: in function device_authorization mutex is not released on error
path.
DESCRIBE:
In ./drivers/media/video/hdpvr/hdpvr-core.c in function device_authorization:
If after mutex lock (line 4) usb_control_msg returns ret!=46 we go to label
error. In this case before exit from function mutex must be unlocked.

01) static int device_authorization(struct hdpvr_device *dev)
02) {
03) ............
04) mutex_lock(&dev->usbc_mutex);
05) ret = usb_control_msg(dev->udev,
06) usb_rcvctrlpipe(dev->udev, 0),
07) rcv_request, 0x80 | request_type,
08) 0x0400, 0x0003,
09) dev->usbc_buf, 46,10000);
10) if (ret != 46) {
11) v4l2_err(&dev->v4l2_dev,
12) "unexpected answer of status request, len %d\n",
ret);
13) goto error;
14) }
15) .................
16) error:
17)
18) return retval;
19) }

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/