Skip to contentSkip to conversation

s5p_mfc: handling failed allocation for workqueue

PATCH New Insu Yun 1 participant 1 message Feb 16, 2016 Media (V4L/DVB)

lore
Share & tools
lore

Insu Yun

author
#0 lore raw

PATCH 1/1 s5p_mfc: handling failed allocation for workqueue

create_singlethread_workqueue() can be failed in memory pressure.

---
 drivers/media/platform/s5p-mfc/s5p_mfc.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/media/platform/s5p-mfc/s5p_mfc.c +4 -0
index 927ab49..631aea814 100644
@@ -1239,6 +1239,10 @@ static int s5p_mfc_probe(struct platform_device *pdev)
 
 	dev->hw_lock = 0;
 	dev->watchdog_workqueue = create_singlethread_workqueue(S5P_MFC_NAME);
+	if (!dev->watchdog_workqueue) {
+		ret = -ENOMEM;
+		goto err_enc_reg;
+	}
 	INIT_WORK(&dev->watchdog_work, s5p_mfc_watchdog_worker);
 	atomic_set(&dev->watchdog_cnt, 0);
 	init_timer(&dev->watchdog_timer);
Signature · 1 line
1.9.1