pm2301_charger: Fix NULL pointer dereference
authorAxel Lin <axel.lin@ingics.com>
Thu, 16 May 2013 09:31:00 +0000 (17:31 +0800)
committerAnton Vorontsov <anton@enomsg.org>
Fri, 7 Jun 2013 00:25:27 +0000 (17:25 -0700)
commitdf311333a8c13f3ffe2537a4ff507887208cb863
tree3d52e87564f8537623d465f52c6d632ee949746b
parent17b4565b308ed31fa20b59842c75e685a101dc8a
pm2301_charger: Fix NULL pointer dereference

Add checking pl_data in probe, this prevent possible NULL pointer
dereference. Also fix NULL pointer deference in dev_err when allocate
memory for pm2 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>
drivers/power/pm2301_charger.c