Skip to contentSkip to conversation

mtd: create_freezable_workqueue() doesn't return an ERR_PTR

PATCH Applied Dan Carpenter 2 participants 2 messages Aug 15, 2013 – Aug 16, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd: create_freezable_workqueue() doesn't return an ERR_PTR

The create_freezable_workqueue() returns a NULL on error, it doesn't return an ERR_PTR.

drivers/mtd/sm_ftl.c +3 -3
index f9d5615..3441e73 100644
@@ -1274,10 +1274,10 @@ static struct mtd_blktrans_ops sm_ftl_ops = {
 static __init int sm_module_init(void)
 {
 	int error = 0;
-	cache_flush_workqueue = create_freezable_workqueue("smflush");
 
-	if (IS_ERR(cache_flush_workqueue))
-		return PTR_ERR(cache_flush_workqueue);
+	cache_flush_workqueue = create_freezable_workqueue("smflush");
+	if (!cache_flush_workqueue)
+		return -ENOMEM;
 
 	error = register_mtd_blktrans(&sm_ftl_ops);
 	if (error)
#1 lore raw

drivers/mtd/sm_ftl.c

Quoted 6 lines · Dan Carpenter

The create_freezable_workqueue() returns a NULL on error, it doesn't return an ERR_PTR.

drivers/mtd/sm_ftl.c +0 -0

Pushed to l2-mtd.git, thanks!

Signature · 2 lines
Best Regards,
Artem Bityutskiy