From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753802AbcGGWj1 (ORCPT ); Thu, 7 Jul 2016 18:39:27 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:34684 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753743AbcGGWjP (ORCPT ); Thu, 7 Jul 2016 18:39:15 -0400 Date: Fri, 8 Jul 2016 01:39:11 +0300 From: Alexey Dobriyan To: tglx@linutronix.de Cc: linux-kernel@vger.kernel.org Subject: [PATCH] posix_cpu_timer: uninitialized variable use in posix_cpu_timer_get() Message-ID: <20160707223911.GA26483@p183.telecom.by> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Variable "now" seems to be genuinely used unintialized if branch if (CPUCLOCK_PERTHREAD(timer->it_clock)) { is not taken and branch if (unlikely(sighand == NULL)) { is taken. I don't know this code to judge what should be done, could someone please look at it? Signed-off-by: Alexey Dobriyan --- kernel/time/posix-cpu-timers.c | 1 + 1 file changed, 1 insertion(+) --- a/kernel/time/posix-cpu-timers.c +++ b/kernel/time/posix-cpu-timers.c @@ -777,6 +777,7 @@ static void posix_cpu_timer_get(struct k_itimer *timer, struct itimerspec *itp) timer->it.cpu.expires = 0; sample_to_timespec(timer->it_clock, timer->it.cpu.expires, &itp->it_value); + return; } else { cpu_timer_sample_group(timer->it_clock, p, &now); unlock_task_sighand(p, &flags);