Patchwork mtd: create_freezable_workqueue() doesn't return an ERR_PTR

login
register
mail settings
Submitter Dan Carpenter
Date Aug. 15, 2013, 7:56 a.m.
Message ID <20130815075628.GC19280@elgon.mountain>
Download mbox | patch
Permalink /patch/267341/
State Accepted
Commit 39de86ef0d333b210d27edad828d4f7cf68feff3
Headers show

Comments

Dan Carpenter - Aug. 15, 2013, 7:56 a.m.
The create_freezable_workqueue() returns a NULL on error, it doesn't
return an ERR_PTR.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Artem Bityutskiy - Aug. 16, 2013, 2:40 p.m.
On Thu, 2013-08-15 at 10:56 +0300, Dan Carpenter wrote:
> The create_freezable_workqueue() returns a NULL on error, it doesn't
> return an ERR_PTR.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/mtd/sm_ftl.c b/drivers/mtd/sm_ftl.c

Pushed to l2-mtd.git, thanks!

Patch

diff --git a/drivers/mtd/sm_ftl.c b/drivers/mtd/sm_ftl.c
index f9d5615..3441e73 100644
--- a/drivers/mtd/sm_ftl.c
+++ b/drivers/mtd/sm_ftl.c
@@ -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)