summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2013-05-16 15:17:04 +0200
committerAnton Vorontsov <anton@enomsg.org>2013-06-07 02:25:48 +0200
commitc509a62c9469e2787bcacc7aba454d555732b0b6 (patch)
tree73972ab9429753156a59a4618f4a7022a96dafb4
parentpm2301_charger: Fix NULL pointer dereference (diff)
downloadlinux-c509a62c9469e2787bcacc7aba454d555732b0b6.tar.xz
linux-c509a62c9469e2787bcacc7aba454d555732b0b6.zip
pm2301_charger: Return error if create_singlethread_workqueue fails
Return error instead of 0 if create_singlethread_workqueue call fails. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
-rw-r--r--drivers/power/pm2301_charger.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/power/pm2301_charger.c b/drivers/power/pm2301_charger.c
index bb346becd7b4..1c0bfcbae062 100644
--- a/drivers/power/pm2301_charger.c
+++ b/drivers/power/pm2301_charger.c
@@ -1075,9 +1075,9 @@ static int pm2xxx_wall_charger_probe(struct i2c_client *i2c_client,
pm2->ac_chg.external = true;
/* Create a work queue for the charger */
- pm2->charger_wq =
- create_singlethread_workqueue("pm2xxx_charger_wq");
+ pm2->charger_wq = create_singlethread_workqueue("pm2xxx_charger_wq");
if (pm2->charger_wq == NULL) {
+ ret = -ENOMEM;
dev_err(pm2->dev, "failed to create work queue\n");
goto free_device_info;
}