aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorCyrill V. Gorcunov <gorcunov@gmail.com>2007-03-22 14:49:01 -0400
committerJean Delvare <khali@arrakis.delvare>2007-03-22 14:49:01 -0400
commit0ca9493b4c0f4fb7796add422ba5ecc672c9fa16 (patch)
treed56517e70bf7acf339b450f9cb29c80d6ea3ea37 /drivers/i2c
parenta5aaea37858fb56d624227408d1dde4cb78c9a6c (diff)
i2c/ds1374: Check workqueue creation status
Check if workqueue creation failed. Further usage of NULL pointed workqueue is not good I guess ;) Signed-off-by: Cyrill V. Gorcunov <gorcunov@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/chips/ds1374.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/i2c/chips/ds1374.c b/drivers/i2c/chips/ds1374.c
index 15edf40828b4..8a2ff0c114d9 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)
207 client->driver = &ds1374_driver; 207 client->driver = &ds1374_driver;
208 208
209 ds1374_workqueue = create_singlethread_workqueue("ds1374"); 209 ds1374_workqueue = create_singlethread_workqueue("ds1374");
210 if (!ds1374_workqueue) {
211 kfree(client);
212 return -ENOMEM; /* most expected reason */
213 }
210 214
211 if ((rc = i2c_attach_client(client)) != 0) { 215 if ((rc = i2c_attach_client(client)) != 0) {
212 kfree(client); 216 kfree(client);