Skip to content

Commit

Permalink
isp1704_charger: Fix missing check
Browse files Browse the repository at this point in the history
A segfault happens if there's no board information.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Acked-by: Heikki Krogerus <krohei@gmail.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
  • Loading branch information
Felipe Contreras authored and Anton Vorontsov committed Jan 6, 2012
1 parent ef7906f commit c934502
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/power/isp1704_charger.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit c934502

Please sign in to comment.