Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1334960 > unrolled thread

[PATCH] s5p_mfc: handling failed allocation for workqueue

Started byInsu Yun <wuninsu@gmail.com>
First post2016-02-16 03:50 +0100
Last post2016-02-16 03:50 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] s5p_mfc: handling failed allocation for workqueue Insu Yun <wuninsu@gmail.com> - 2016-02-16 03:50 +0100

#1334960 — [PATCH] s5p_mfc: handling failed allocation for workqueue

FromInsu Yun <wuninsu@gmail.com>
Date2016-02-16 03:50 +0100
Subject[PATCH] s5p_mfc: handling failed allocation for workqueue
Message-ID<r2DSa-1uE-5@gated-at.bofh.it>
create_singlethread_workqueue() can be failed in memory pressure.

Signed-off-by: Insu Yun <wuninsu@gmail.com>
---
 drivers/media/platform/s5p-mfc/s5p_mfc.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c
index 927ab49..631aea814 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
@@ -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);
-- 
1.9.1

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web