Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0ca9493b authored by Cyrill V. Gorcunov's avatar Cyrill V. Gorcunov Committed by Jean Delvare
Browse files

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: default avatarCyrill V. Gorcunov <gorcunov@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
parent a5aaea37
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -207,6 +207,10 @@ static int ds1374_probe(struct i2c_adapter *adap, int addr, int kind)
	client->driver = &ds1374_driver;
	client->driver = &ds1374_driver;


	ds1374_workqueue = create_singlethread_workqueue("ds1374");
	ds1374_workqueue = create_singlethread_workqueue("ds1374");
	if (!ds1374_workqueue) {
		kfree(client);
		return -ENOMEM;	/* most expected reason */
	}


	if ((rc = i2c_attach_client(client)) != 0) {
	if ((rc = i2c_attach_client(client)) != 0) {
		kfree(client);
		kfree(client);