From: "Cyrill V. Gorcunov" <gorcunov@gmail.com>
To: Randy Vinson <rvinson@mvista.com>
Cc: linux-kernel-list <linux-kernel@vger.kernel.org>
Subject: [PATCH] DS1374: check for workqueue creation
Date: Sat, 17 Feb 2007 00:08:44 +0300 [thread overview]
Message-ID: <20070216210844.GB10190@cvg> (raw)
This patch checks if workqueue creation failed.
Further usage of NULL pointed workqueue is not
good I guess ;)
Signed-off-by: Cyrill V. Gorcunov <gorcunov@gmail.com>
---
drivers/i2c/chips/ds1374.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/i2c/chips/ds1374.c b/drivers/i2c/chips/ds1374.c
index 15edf40..8a2ff0c 100644
--- a/drivers/i2c/chips/ds1374.c
+++ b/drivers/i2c/chips/ds1374.c
@@ -207,6 +207,10 @@ static int ds1374_probe(struct i2c_adapter *adap, int addr, int kind)
client->driver = &ds1374_driver;
ds1374_workqueue = create_singlethread_workqueue("ds1374");
+ if (!ds1374_workqueue) {
+ kfree(client);
+ return -ENOMEM; /* most expected reason */
+ }
if ((rc = i2c_attach_client(client)) != 0) {
kfree(client);
reply other threads:[~2007-02-16 21:11 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20070216210844.GB10190@cvg \
--to=gorcunov@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rvinson@mvista.com \
/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
all inboxes | Powered by JetHome®