* [PATCH] UBI: block: Fix error path on alloc_workqueue failure
@ 2014-05-20 9:13 Helmut Schaa
2014-05-20 23:30 ` Brian Norris
0 siblings, 1 reply; 2+ messages in thread
From: Helmut Schaa @ 2014-05-20 9:13 UTC (permalink / raw)
To: linux-mtd; +Cc: Brian Norris, David Woodhouse, Helmut Schaa, Artem Bityutskiy
Otherwise we'd return a random value if allocation of the workqueue fails.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
---
Just stumbled over that one while playing with UBI block devices.
drivers/mtd/ubi/block.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/mtd/ubi/block.c b/drivers/mtd/ubi/block.c
index 8d659e6..389e5f0 100644
--- a/drivers/mtd/ubi/block.c
+++ b/drivers/mtd/ubi/block.c
@@ -432,8 +432,10 @@ int ubiblock_create(struct ubi_volume_info *vi)
* Rembember workqueues are cheap, they're not threads.
*/
dev->wq = alloc_workqueue("%s", 0, 0, gd->disk_name);
- if (!dev->wq)
+ if (!dev->wq) {
+ ret = -ENOMEM;
goto out_free_queue;
+ }
INIT_WORK(&dev->work, ubiblock_do_work);
mutex_lock(&devices_mutex);
--
1.8.4.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] UBI: block: Fix error path on alloc_workqueue failure
2014-05-20 9:13 [PATCH] UBI: block: Fix error path on alloc_workqueue failure Helmut Schaa
@ 2014-05-20 23:30 ` Brian Norris
0 siblings, 0 replies; 2+ messages in thread
From: Brian Norris @ 2014-05-20 23:30 UTC (permalink / raw)
To: Helmut Schaa; +Cc: David Woodhouse, linux-mtd, Artem Bityutskiy
On Tue, May 20, 2014 at 11:13:48AM +0200, Helmut Schaa wrote:
> Otherwise we'd return a random value if allocation of the workqueue fails.
>
> Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
> ---
> Just stumbled over that one while playing with UBI block devices.
Acked-by: Brian Norris <computersforpeace@gmail.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-05-20 23:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-20 9:13 [PATCH] UBI: block: Fix error path on alloc_workqueue failure Helmut Schaa
2014-05-20 23:30 ` Brian Norris
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox