android_kernel_samsung_msm8976/kernel/time
Richard Cochran 794c33bd21 posix-clock: Fix return code on the poll method's error path
commit 1b9f23727abb92c5e58f139e7d180befcaa06fe0 upstream.

The posix_clock_poll function is supposed to return a bit mask of
POLLxxx values.  However, in case the hardware has disappeared (due to
hot plugging for example) this code returns -ENODEV in a futile
attempt to throw an error at the file descriptor level.  The kernel's
file_operations interface does not accept such error codes from the
poll method.  Instead, this function aught to return POLLERR.

The value -ENODEV does, in fact, contain the POLLERR bit (and almost
all the other POLLxxx bits as well), but only by chance.  This patch
fixes code to return a proper bit mask.

Credit goes to Markus Elfring for pointing out the suspicious
signed/unsigned mismatch.

Reported-by: Markus Elfring <elfring@users.sourceforge.net>
igned-off-by: Richard Cochran <richardcochran@gmail.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Julia Lawall <julia.lawall@lip6.fr>
Link: http://lkml.kernel.org/r/1450819198-17420-1-git-send-email-richardcochran@gmail.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-03 15:06:23 -08:00
..
Kconfig Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-05-15 14:05:17 -07:00
Makefile time: remove the timecompare code. 2012-11-01 11:41:35 -04:00
alarmtimer.c alarmtimer: Lock k_itimer during timer callback 2014-10-05 14:54:14 -07:00
clockevents.c timer: Fix lock inversion between hrtimer_bases.lock and scheduler locks 2014-08-07 14:30:26 -07:00
clocksource.c
jiffies.c time: Fix overflow when HZ is smaller than 60 2014-02-22 12:41:29 -08:00
ntp.c ntp: Fixup adjtimex freq validation on 32-bit systems 2015-03-06 14:40:52 -08:00
ntp_internal.h ntp: Rework do_adjtimex to take timespec and tai arguments 2013-04-04 13:18:15 -07:00
posix-clock.c posix-clock: Fix return code on the poll method's error path 2016-03-03 15:06:23 -08:00
tick-broadcast.c tick: Make oneshot broadcast robust vs. CPU offlining 2014-03-23 21:38:21 -07:00
tick-common.c clockevents: Prefer CPU local devices over global devices 2013-12-08 07:29:27 -08:00
tick-internal.h clockevents: Get rid of the notifier chain 2013-12-08 07:29:27 -08:00
tick-oneshot.c
tick-sched.c nohz: Fix another inconsistency between CONFIG_NO_HZ=n and nohz=off 2014-06-26 15:12:41 -04:00
timeconv.c
timekeeping.c timekeeping: Avoid possible deadlock from clock_was_set_delayed 2014-02-13 13:48:04 -08:00
timer_list.c timer_list: correct the iterator for timer_list 2013-09-07 22:09:58 -07:00
timer_stats.c