Skip to contentSkip to conversation

New: in function device_authorization mutex is not released on error path.

Bugme-new Andrew Morton 1 participant 1 message Aug 11, 2009 1 message not in the archive Media (V4L/DVB)

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]/

#1 lore raw

(switched to email. Please respond via emailed reply-to-all, not via the bugzilla web interface).

Quoted 34 lines · On Mon, 10 Aug 2009 08:16:08 GMT [email protected] wrote:

http://bugzilla.kernel.org/show_bug.cgi?id=13951

Summary: in function device_authorization mutex is not released
on error path.
Product: Drivers
Version: 2.5
Kernel Version: 2.6.30
Platform: All
OS/Version: Linux
Tree: Mainline
Status: NEW
Severity: normal
Priority: P1
Component: Video(Other)
AssignedTo: [email protected]
ReportedBy: [email protected]
Regression: No

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);
Quoted 12 lines

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) }

Alexander, it would make life simpler if you were to just email patches which fix things like this!

Thanks.