[PATCH 1/2] isp1704_charger: fix missing check

From: Felipe Contreras
Date: Mon Dec 05 2011 - 12:24:27 EST


From: Felipe Contreras <felipe.contreras@xxxxxxxxx>

A segfault happens if there's no board information.

Signed-off-by: Felipe Contreras <felipe.contreras@xxxxxxxxx>
---
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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/