History

[media] vivid: fix error return code in vivid_create_instance()

Fix to return error code -ENOMEM from the memory or workqueue alloc error handling case instead of 0, as done elsewhere in this function.

Wei Yongjun committed 10 years ago

Commit a38aaaa1 parent e1618a51 file · +4 −1Browse files

Unified · Split

drivers/media/platform/vivid/vivid-core.c+4−1
@@ -839,6 +839,7 @@ static int vivid_create_instance(struct platform_device *pdev, int inst) · 838 unmodified lines
839839 dev->radio_tx_caps = V4L2_CAP_RDS_OUTPUT | V4L2_CAP_MODULATOR |
840840 V4L2_CAP_READWRITE;
841841
842+ ret = -ENOMEM;
842843 /* initialize the test pattern generator */
843844 tpg_init(&dev->tpg, 640, 360);
844845 if (tpg_alloc(&dev->tpg, MAX_ZOOM * MAX_WIDTH))
@@ -1033,8 +1034,10 @@ static int vivid_create_instance(struct platform_device *pdev, int inst) · 188 unmodified lines
10331034 */
10341035 dev->cec_workqueue =
10351036 alloc_ordered_workqueue("vivid-%03d-cec", WQ_MEM_RECLAIM, inst);
1036− if (!dev->cec_workqueue)
1037+ if (!dev->cec_workqueue) {
1038+ ret = -ENOMEM;
10371039 goto unreg_dev;
1040+ }
10381041
10391042 /* start creating the vb2 queues */
10401043 if (dev->has_vid_cap) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t