From: "Cyrill V. Gorcunov" Subject: 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 --- drivers/i2c/chips/ds1374.c | 4 ++++ 1 file changed, 4 insertions(+) --- linux-2.6.21-rc2.orig/drivers/i2c/chips/ds1374.c 2007-02-04 19:44:54.000000000 +0100 +++ linux-2.6.21-rc2/drivers/i2c/chips/ds1374.c 2007-03-06 17:02:57.000000000 +0100 @@ -207,6 +207,10 @@ static int ds1374_probe(struct i2c_adapt 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);