mfd: pm8921: Potential NULL dereference in pm8921_remove()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 7 Nov 2013 08:04:20 +0000 (11:04 +0300)
committerWilly Tarreau <w@1wt.eu>
Wed, 7 Jun 2017 22:47:00 +0000 (00:47 +0200)
commitdad5635c15055b22304f11423442522dd8c086c4
treecfbfa800aa1bf7c31ee37056cdafb8d48a554349
parent511ae3b96a0f36719924dac16b5e98fbd9320d25
mfd: pm8921: Potential NULL dereference in pm8921_remove()

commit d6daef95127e41233ac8e2d8472d8c0cd8687d38 upstream.

We assume that "pmic" could be NULL and then dereference it two lines
later.  I fix this by moving the dereference inside the NULL check.

Fixes: c013f0a56c56 ('mfd: Add pm8xxx irq support')

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Willy Tarreau <w@1wt.eu>
drivers/mfd/pm8921-core.c