From: Helmut Schaa <helmut.schaa@googlemail.com>
To: linux-mtd@lists.infradead.org
Cc: Brian Norris <computersforpeace@gmail.com>,
David Woodhouse <dwmw2@infradead.org>,
Helmut Schaa <helmut.schaa@googlemail.com>,
Artem Bityutskiy <dedekind1@gmail.com>
Subject: [PATCH] UBI: block: Fix error path on alloc_workqueue failure
Date: Tue, 20 May 2014 11:13:48 +0200 [thread overview]
Message-ID: <1400577228-7835-1-git-send-email-helmut.schaa@googlemail.com> (raw)
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
next reply other threads:[~2014-05-20 9:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-20 9:13 Helmut Schaa [this message]
2014-05-20 23:30 ` [PATCH] UBI: block: Fix error path on alloc_workqueue failure Brian Norris
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1400577228-7835-1-git-send-email-helmut.schaa@googlemail.com \
--to=helmut.schaa@googlemail.com \
--cc=computersforpeace@gmail.com \
--cc=dedekind1@gmail.com \
--cc=dwmw2@infradead.org \
--cc=linux-mtd@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox