LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] DS1374: check for workqueue creation
@ 2007-02-16 21:08 Cyrill V. Gorcunov
0 siblings, 0 replies; only message in thread
From: Cyrill V. Gorcunov @ 2007-02-16 21:08 UTC (permalink / raw)
To: Randy Vinson; +Cc: linux-kernel-list
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);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-02-16 21:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-16 21:08 [PATCH] DS1374: check for workqueue creation Cyrill V. Gorcunov
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).