Skip to contentSkip to conversation

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

DISCUSSION iceberg 1 participant 1 message Jul 3, 2009

lore
Share & tools
lore

iceberg

author
#0 lore raw
	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) }