* [patch] dm: fix an error code in local_init()
@ 2014-07-08 10:55 Dan Carpenter
2014-07-08 16:21 ` Mike Snitzer
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2014-07-08 10:55 UTC (permalink / raw)
To: Alasdair Kergon
Cc: Mike Snitzer, dm-devel, Neil Brown, linux-raid, kernel-janitors
We return success if we can't allocate a work queue but we should return
-ENOMEM. The code was a bit messy so that's why this small bug was
introduced and I have cleaned that as well.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 3281615..aa2b12e 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -263,12 +263,12 @@ EXPORT_SYMBOL_GPL(dm_get_reserved_rq_based_ios);
static int __init local_init(void)
{
- int r = -ENOMEM;
+ int r;
/* allocate a slab for the dm_ios */
_io_cache = KMEM_CACHE(dm_io, 0);
if (!_io_cache)
- return r;
+ return -ENOMEM;
_rq_tio_cache = KMEM_CACHE(dm_rq_target_io, 0);
if (!_rq_tio_cache)
@@ -279,8 +279,10 @@ static int __init local_init(void)
goto out_free_rq_tio_cache;
deferred_remove_workqueue = alloc_workqueue("kdmremove", WQ_UNBOUND, 1);
- if (!deferred_remove_workqueue)
+ if (!deferred_remove_workqueue) {
+ r = -ENOMEM;
goto out_uevent_exit;
+ }
_major = major;
r = register_blkdev(_major, _name);
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-07-08 16:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-08 10:55 [patch] dm: fix an error code in local_init() Dan Carpenter
2014-07-08 16:21 ` Mike Snitzer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).