Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix VDSO gettimeofday() when called with NULL struct timeval.

The vdso64 portion of patch 74609f4536f2b8fd6a48381bbbe3cd37da20a527 for
fixing problems with NULL gettimeofday input mistakenly checks for a
null tz field twice, when it should be checking for null tz once, and
null tv once; by way of a r10/r11 typo.

Any application calling gettimeofday(&tv,NULL) will "fail".

This corrects that typo, and makes my G5 happy.

Tested on G5.

Signed-off-by: Will Schmidt <will_schmidt@vnet.ibm.com>
Cc: Tony Breeds <tony@bakeyournoodle.com>
Forwarded-by: Ben Herrenschmidt <benh@kernel.crashing.org>

[ Ben says: "I checked the 32 bits part of the change is correct. You
can probably blame me for originally writing the 2 versions with
inversed usage of r10 and r11, thus confusing Tony :-)"

Ben duly blamed. - Linus ]

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Will Schmidt and committed by
Linus Torvalds
fde937d8 0471448f

+1 -1
+1 -1
arch/powerpc/kernel/vdso64/gettimeofday.S
··· 31 31 mr r11,r3 /* r11 holds tv */ 32 32 mr r10,r4 /* r10 holds tz */ 33 33 bl V_LOCAL_FUNC(__get_datapage) /* get data page */ 34 - cmpldi r10,0 /* check if tv is NULL */ 34 + cmpldi r11,0 /* check if tv is NULL */ 35 35 beq 2f 36 36 bl V_LOCAL_FUNC(__do_get_xsec) /* get xsec from tb & kernel */ 37 37 lis r7,15 /* r7 = 1000000 = USEC_PER_SEC */