[PATCH 1/2] isp1704_charger: fix missing check

Felipe Contreras
2011-12-05T17:24:27Z

From: Felipe Contreras <felipe.contreras@gmail.com>

A segfault happens if there's no board information.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
drivers/power/isp1704_charger.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/power/isp1704_charger.c b/drivers/power/isp1704_charger.c
index f6d72b4..768cf5e 100644
--- a/drivers/power/isp1704_charger.c
+++ b/drivers/power/isp1704_charger.c
@@ -79,7 +79,7 @@ static void isp1704_charger_set_power(struct isp1704_charger *isp, bool on)
{
struct isp1704_charger_data *board = isp->dev->platform_data;

- if (board->set_power)
+ if (board && board->set_power)
board->set_power(on);
}

--
1.7.8.rc3.17.gf56ef1