From c934502db7fda4fac1bb3b5c74f35e9bde8e7547 Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Fri, 6 Jan 2012 06:00:48 +0400 Subject: isp1704_charger: Fix missing check A segfault happens if there's no board information. Signed-off-by: Felipe Contreras Acked-by: Heikki Krogerus Signed-off-by: Anton Vorontsov --- drivers/power/isp1704_charger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/power/isp1704_charger.c') diff --git a/drivers/power/isp1704_charger.c b/drivers/power/isp1704_charger.c index 6a4ef387a183..b806667b59ae 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); } -- cgit v1.2.3