[POWERPC] Fix VDSO gettimeofday() when called with NULL struct timeval
authorTony Breeds <tony@bakeyournoodle.com>
Mon, 25 Jun 2007 23:50:32 +0000 (09:50 +1000)
committerPaul Mackerras <paulus@samba.org>
Tue, 26 Jun 2007 04:41:19 +0000 (14:41 +1000)
commit74609f4536f2b8fd6a48381bbbe3cd37da20a527
treef73c0abf05df85497b0323290e6cfff948a7fadd
parentca74c013441200b162f6a384b23b833d1865a9e8
[POWERPC] Fix VDSO gettimeofday() when called with NULL struct timeval

Consider the prototype for gettimeofday():
int gettimofday(struct timeval *tv, struct timezone *tz);

Although it is valid to call with /either/ tv or tz being NULL, and
the C version of sys_gettimeofday() supports this, the current version
of gettimeofday() in the VDSO will SEGV if called with a NULL tv.

This adds a check for tv being NULL so that it doesn't SEGV.

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/kernel/vdso32/gettimeofday.S
arch/powerpc/kernel/vdso64/gettimeofday.S