From: Cyrill V. Gorcunov Date: Thu, 22 Mar 2007 18:49:01 +0000 (+0100) Subject: i2c/ds1374: Check workqueue creation status X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=0ca9493b4c0f4fb7796add422ba5ecc672c9fa16;p=linux-beck.git 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 Signed-off-by: Andrew Morton Signed-off-by: Jean Delvare --- 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) 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);