]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
i2c/ds1374: Check workqueue creation status
authorCyrill V. Gorcunov <gorcunov@gmail.com>
Thu, 22 Mar 2007 18:49:01 +0000 (19:49 +0100)
committerJean Delvare <khali@arrakis.delvare>
Thu, 22 Mar 2007 18:49:01 +0000 (19:49 +0100)
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>
drivers/i2c/chips/ds1374.c

index 15edf40828b479172d615347780f3bb2f2d8ce51..8a2ff0c114d9db7460c3b8177d9dbec2472456fa 100644 (file)
@@ -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);