From patchwork Fri Feb 28 08:45:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 25512 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f200.google.com (mail-vc0-f200.google.com [209.85.220.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BF145203C5 for ; Fri, 28 Feb 2014 08:45:55 +0000 (UTC) Received: by mail-vc0-f200.google.com with SMTP id le5sf868965vcb.7 for ; Fri, 28 Feb 2014 00:45:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=z2uBzECYA8kdwyGttb6ggCmFq3mNkzUtSbTMwc2IOyg=; b=M7upHMpUfzqxHpGnmjZxxFI8cMxloIaXBF8M/wd3Ztjrs0Lb5qjFLI2hgR7sAA0VRS R87v+t+NhiSih31mpAgrPT5eLyQAQpnGlE22pTg0fQlM75m9fqhQ+xRDmmpclr7fT/LF pCtqRZyG9VcuQoWEW0vcaHaZNttHYjioIgp9g7KMel2Abp2mm1EwWK03/Borrutr5Mx0 50qn/46g7mVyo6Wp6xcYDClztKlG7qjdZqbgVPElV79g/iDwAeIAK2BhtdHU/f6CTj4m MGT+EeYJEKLzjrpqAg+unRyH42Ywqi/7qP/vf6qhPNsRZC5sLQHEymoWHHnCRBquubZT tFmw== X-Gm-Message-State: ALoCoQlIABdrG+N16mgF73+rXixL9+I38+Nnxwwc96Kr6EYa/5FwyCkBxEeJBnJXpOtugxF3Xcmr X-Received: by 10.236.120.11 with SMTP id o11mr506939yhh.39.1393577155170; Fri, 28 Feb 2014 00:45:55 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.40.11 with SMTP id w11ls966853qgw.42.gmail; Fri, 28 Feb 2014 00:45:55 -0800 (PST) X-Received: by 10.52.190.1 with SMTP id gm1mr12360382vdc.21.1393577155046; Fri, 28 Feb 2014 00:45:55 -0800 (PST) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id uw4si375837vdc.118.2014.02.28.00.45.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 28 Feb 2014 00:45:55 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id la4so407015vcb.7 for ; Fri, 28 Feb 2014 00:45:54 -0800 (PST) X-Received: by 10.58.91.101 with SMTP id cd5mr67884veb.5.1393577154915; Fri, 28 Feb 2014 00:45:54 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.130.193 with SMTP id u1csp38753vcs; Fri, 28 Feb 2014 00:45:53 -0800 (PST) X-Received: by 10.66.218.234 with SMTP id pj10mr2139310pac.156.1393577153289; Fri, 28 Feb 2014 00:45:53 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id zj6si1180744pac.262.2014.02.28.00.45.52; Fri, 28 Feb 2014 00:45:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751829AbaB1Ipg (ORCPT + 26 others); Fri, 28 Feb 2014 03:45:36 -0500 Received: from mail-we0-f175.google.com ([74.125.82.175]:63186 "EHLO mail-we0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750927AbaB1Ipe (ORCPT ); Fri, 28 Feb 2014 03:45:34 -0500 Received: by mail-we0-f175.google.com with SMTP id q59so282488wes.6 for ; Fri, 28 Feb 2014 00:45:33 -0800 (PST) X-Received: by 10.180.102.42 with SMTP id fl10mr2133863wib.42.1393577133479; Fri, 28 Feb 2014 00:45:33 -0800 (PST) Received: from localhost ([213.122.173.131]) by mx.google.com with ESMTPSA id h13sm2539221wjr.22.2014.02.28.00.45.29 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 28 Feb 2014 00:45:32 -0800 (PST) From: Viresh Kumar To: tglx@linutronix.de Cc: linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, fweisbec@gmail.com, tj@kernel.org, peterz@infradead.org, mingo@kernel.org, Viresh Kumar Subject: [PATCH 1/2] timer: check failure of timer_cpu_notify() before calling init_timer_stats() Date: Fri, 28 Feb 2014 14:15:21 +0530 Message-Id: X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , timer_cpu_notify() should return NOTIFY_OK and nothing else. Anything else would trigger a BUG_ON(). Return value of this routine is already checked correctly but is done after issuing a call to init_timer_stats(). The right order would be to check the error case first and then call init_timer_stats(). Lets do it. Signed-off-by: Viresh Kumar --- kernel/timer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/timer.c b/kernel/timer.c index f64a98c..e8e7839 100644 --- a/kernel/timer.c +++ b/kernel/timer.c @@ -1674,9 +1674,9 @@ void __init init_timers(void) err = timer_cpu_notify(&timers_nb, (unsigned long)CPU_UP_PREPARE, (void *)(long)smp_processor_id()); - init_timer_stats(); - BUG_ON(err != NOTIFY_OK); + + init_timer_stats(); register_cpu_notifier(&timers_nb); open_softirq(TIMER_SOFTIRQ, run_timer_softirq); }