]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - kernel/time/posix-cpu-timers.c
posix-cpu-timers: Sanitize bogus WARNONS
authorThomas Gleixner <tglx@linutronix.de>
Mon, 19 Aug 2019 14:31:46 +0000 (16:31 +0200)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 16 Oct 2019 09:55:37 +0000 (11:55 +0200)
commit2a3a44792a260d7f06d280a776866fc84598e5d0
tree8b3ef1bd35a17a5cc57e871099bc454d89cb1ed7
parent62c50accd0ef7f17ba1bd73bd4bd07ff2c7c5089
posix-cpu-timers: Sanitize bogus WARNONS

BugLink: https://bugs.launchpad.net/bugs/1847155
[ Upstream commit 692117c1f7a6770ed41dd8f277cd9fed1dfb16f1 ]

Warning when p == NULL and then proceeding and dereferencing p does not
make any sense as the kernel will crash with a NULL pointer dereference
right away.

Bailing out when p == NULL and returning an error code does not cure the
underlying problem which caused p to be NULL. Though it might allow to
do proper debugging.

Same applies to the clock id check in set_process_cpu_timer().

Clean them up and make them return without trying to do further damage.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Link: https://lkml.kernel.org/r/20190819143801.846497772@linutronix.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
kernel/time/posix-cpu-timers.c