]> git.baikalelectronics.ru Git - kernel.git/commit
time: Make settimeofday error checking work again
authorJohn Stultz <john.stultz@linaro.org>
Wed, 1 Jun 2016 18:53:26 +0000 (11:53 -0700)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 1 Jun 2016 19:13:43 +0000 (21:13 +0200)
commit8b6b215a97d06a4c376b1372d704441b3ef6a8c5
tree2dc402ef2db9972b048b1dbe80d6b5122cd6eb7a
parenteafb69e30fd2c5eb541ab8464cb7c24186e23039
time: Make settimeofday error checking work again

In commit 63079c519201 some of the checking for a valid timeval
was subtley changed which caused -EINVAL to be returned whenever
the timeval was null.

However, it is possible to set the timezone data while specifying
a NULL timeval, which is usually done to handle systems where the
RTC keeps local time instead of UTC. Thus the patch causes such
systems to have the time incorrectly set.

This patch addresses the issue by handling the error conditionals
in the same way as was done previously.

Fixes: 63079c519201 "time: Introduce do_sys_settimeofday64()"
Reported-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Prarit Bhargava <prarit@redhat.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Baolin Wang <baolin.wang@linaro.org>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Shuah Khan <shuahkh@osg.samsung.com>
Link: http://lkml.kernel.org/r/1464807207-16530-2-git-send-email-john.stultz@linaro.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
include/linux/timekeeping.h