aboutsummaryrefslogtreecommitdiff
path: root/drivers/power
diff options
context:
space:
mode:
authorNelson Castillo <arhuaco@freaks-unidos.net>2009-05-14 23:46:41 -0500
committerNelson Castillo <arhuaco@freaks-unidos.net>2009-05-14 23:46:41 -0500
commit4fc401c9b26be1765de71791e15e59093df94eac (patch)
tree0df3dc9d17d2c0b161136d922ba5b52b09a9956c /drivers/power
parentf656a97d946a2529630c9770a72c10a24dc397f9 (diff)
Avoid null pointer access on early call to pcf50633_mbc_get_status
Avoid a kernel panic during an early call to the pcf50633_mbc_get_status function.
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/pcf50633-charger.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/power/pcf50633-charger.c b/drivers/power/pcf50633-charger.c
index 8772604ae1a..1bdb9906201 100644
--- a/drivers/power/pcf50633-charger.c
+++ b/drivers/power/pcf50633-charger.c
@@ -114,6 +114,9 @@ int pcf50633_mbc_get_status(struct pcf50633 *pcf)
struct pcf50633_mbc *mbc = platform_get_drvdata(pcf->mbc_pdev);
int status = 0;
+ if (!mbc)
+ return 0;
+
if (mbc->usb_online)
status |= PCF50633_MBC_USB_ONLINE;
if (mbc->usb_active)