Skip to content

Commit

Permalink
[MIPS] Check function pointers are non-zero before calling.
Browse files Browse the repository at this point in the history
    
Several boards don't initialize the pointers, so let's play safe.
    
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
Ralf Baechle committed Feb 7, 2006
1 parent a3305a8 commit 9414d36
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions arch/mips/kernel/reset.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,18 @@ void (*_machine_power_off)(void);

void machine_restart(char *command)
{
_machine_restart(command);
if (_machine_restart)
_machine_restart(command);
}

void machine_halt(void)
{
_machine_halt();
if (_machine_halt)
_machine_halt();
}

void machine_power_off(void)
{
_machine_power_off();
if (_machine_power_off)
_machine_power_off();
}

0 comments on commit 9414d36

Please sign in to comment.