mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
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]>
This commit is contained in:
parent
a5aaea3785
commit
0ca9493b4c
1 changed files with 4 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue