Fix to return error code -ENOMEM from the memory or workqueue alloc error handling case instead of 0, as done elsewhere in this function.
Unified · Split
| @@ -839,6 +839,7 @@ static int vivid_create_instance(struct platform_device *pdev, int inst) · 838 unmodified lines | |||
| 839 | dev->radio_tx_caps = V4L2_CAP_RDS_OUTPUT | V4L2_CAP_MODULATOR | | 839 | dev->radio_tx_caps = V4L2_CAP_RDS_OUTPUT | V4L2_CAP_MODULATOR | |
| 840 | V4L2_CAP_READWRITE; | 840 | V4L2_CAP_READWRITE; |
| 841 | 841 | ||
| 842 | ret = -ENOMEM; | ||
| 842 | /* initialize the test pattern generator */ | 843 | /* initialize the test pattern generator */ |
| 843 | tpg_init(&dev->tpg, 640, 360); | 844 | tpg_init(&dev->tpg, 640, 360); |
| 844 | if (tpg_alloc(&dev->tpg, MAX_ZOOM * MAX_WIDTH)) | 845 | 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 | |||
| 1033 | */ | 1034 | */ |
| 1034 | dev->cec_workqueue = | 1035 | dev->cec_workqueue = |
| 1035 | alloc_ordered_workqueue("vivid-%03d-cec", WQ_MEM_RECLAIM, inst); | 1036 | alloc_ordered_workqueue("vivid-%03d-cec", WQ_MEM_RECLAIM, inst); |
| 1036 | if (!dev->cec_workqueue) | 1037 | if (!dev->cec_workqueue) { |
| 1038 | ret = -ENOMEM; | ||
| 1037 | goto unreg_dev; | 1039 | goto unreg_dev; |
| 1040 | } | ||
| 1038 | 1041 | ||
| 1039 | /* start creating the vb2 queues */ | 1042 | /* start creating the vb2 queues */ |
| 1040 | if (dev->has_vid_cap) { | 1043 | if (dev->has_vid_cap) { |