From: Ralf Baechle Date: Tue, 17 Jan 2006 21:14:01 +0000 (+0000) Subject: [MIPS] Check function pointers are non-zero before calling. X-Git-Tag: v2.6.16-rc3~137^2~36 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9414d3628abb646834965b6c23b8e9064729b110;p=linux-2.6 [MIPS] Check function pointers are non-zero before calling. Several boards don't initialize the pointers, so let's play safe. Signed-off-by: Ralf Baechle --- diff --git a/arch/mips/kernel/reset.c b/arch/mips/kernel/reset.c index ae2ba67b7e..a131aa0cbe 100644 --- a/arch/mips/kernel/reset.c +++ b/arch/mips/kernel/reset.c @@ -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(); } -