Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0ca9493b4c0f4fb7796add422ba5ecc672c9fa16
Commit:     0ca9493b4c0f4fb7796add422ba5ecc672c9fa16
Parent:     a5aaea37858fb56d624227408d1dde4cb78c9a6c
Author:     Cyrill V. Gorcunov <[EMAIL PROTECTED]>
AuthorDate: Thu Mar 22 19:49:01 2007 +0100
Committer:  Jean Delvare <[EMAIL PROTECTED]>
CommitDate: Thu Mar 22 19:49:01 2007 +0100

    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 <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Jean Delvare <[EMAIL PROTECTED]>
---
 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);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to