Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2511573imm; Mon, 28 May 2018 09:28:02 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo4y07ZADH5hofl69yD3eKvF7oc4G5VwJstulntq7Xask65LoQVa9lS3WTDR2nqxUw+FkvQ X-Received: by 2002:aa7:8201:: with SMTP id k1-v6mr14084651pfi.97.1527524882604; Mon, 28 May 2018 09:28:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527524882; cv=none; d=google.com; s=arc-20160816; b=PUG/kD2MOlWSZDlM+2ZND+96aOu3+4S0Iqm6oHmuD2ujFpWoBs8+BJRBbpOut4cfV6 JnAwqR+FVV6rFuYnd8OacunsWJjFIxD5djUqv6X3YeNRgEP3+H2/0M+n3Zaayj007sPC qSN9gaa6uSPrwX0Z6Sq3nk8v3JvfG3lpGpmEKmqt7yzVmut9oxDTa9zNbZr1JjTWzgxn 8qjTbcNEk2taHbAMByek7qLknXFYSgi8gACF9O4eYaa26Dkur0aCE7aWW50SDif3xaOH QVpqICNTbxLrcoQyP8EaRiDLVYq1VcoLitE5+YOxMYj58am5Q/I5IIIt/V0MfR67TFcH YLAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=GWxQ7/X6E8H023Npx7uQc3xdg1YehG2shSs4Apae4TA=; b=09ZAs1c9PSbElSecX0qAqrmb3p6l3Y0Wbk7D9WUOyuc+7/VTPQH/E7fIUJFdRDuAql ajoK6kQt3FQu5QQsk7POW8J2qcBBoSsq+foEzTdw3Ppkczynn+F0AN7SIvLfdjtQaaO/ wE/0x3Jnqw/Rh1poPuGUKuDbfBRC4Jg/Htai5wRpe2czCrJyLCkYvHr/D/QHXUj+WhAM 2h66Gf8kg2bSF6tidE9BuV9G9Z8qnmfTmBPDUK4sxShDGTV9wd7Aoi6ILKyIGxdPVfc+ CYCesAw2D/A31eNHavCHCei865+AV1xA2bU6XICy9cRJ26KFD+GNJahL4mjhkUt3yYhU sB1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=y2BEWwgt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ba9-v6si31073071plb.110.2018.05.28.09.27.48; Mon, 28 May 2018 09:28:02 -0700 (PDT) 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; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=y2BEWwgt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S940044AbeE1Q1S (ORCPT + 99 others); Mon, 28 May 2018 12:27:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:58524 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933411AbeE1KKV (ORCPT ); Mon, 28 May 2018 06:10:21 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1C5E3208A6; Mon, 28 May 2018 10:10:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527502220; bh=AB1OdLVr7hSjqy+3ISLqYmmbePY51ZZSvJ0T7j5Qdr0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=y2BEWwgtGzx+uRRKBYYvQqoVfl3UjY/6Su7mPNfQAUXSq6SXRTU9vnhhJmbax2Abp qCWHRQkynGr+JJBgzK6mS8j+gtgkK+Apa+Yj58eJjDIg/v3pgVVnCDAXaWymcxrpO4 fZywxIiedUpNPm03TU228e08tr2dgyHG5Dw9X9Ig= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Colin Ian King , Thomas Gleixner , Daniel Lezcano , kernel-janitors@vger.kernel.org, Sasha Levin Subject: [PATCH 3.18 077/185] clocksource/drivers/fsl_ftm_timer: Fix error return checking Date: Mon, 28 May 2018 12:01:58 +0200 Message-Id: <20180528100057.270284399@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100050.700971285@linuxfoundation.org> References: <20180528100050.700971285@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Colin Ian King [ Upstream commit f287eb9013ccf199cbfa4eabd80c36fedfc15a73 ] The error checks on freq for a negative error return always fails because freq is unsigned and can never be negative. Fix this by making freq a signed long. Detected with Coccinelle: drivers/clocksource/fsl_ftm_timer.c:287:5-9: WARNING: Unsigned expression compared with zero: freq <= 0 drivers/clocksource/fsl_ftm_timer.c:291:5-9: WARNING: Unsigned expression compared with zero: freq <= 0 Fixes: 2529c3a33079 ("clocksource: Add Freescale FlexTimer Module (FTM) timer support") Signed-off-by: Colin Ian King Signed-off-by: Thomas Gleixner Cc: Daniel Lezcano Cc: kernel-janitors@vger.kernel.org Link: https://lkml.kernel.org/r/20180226113614.3092-1-colin.king@canonical.com Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/clocksource/fsl_ftm_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/clocksource/fsl_ftm_timer.c +++ b/drivers/clocksource/fsl_ftm_timer.c @@ -282,7 +282,7 @@ static int __init __ftm_clk_init(struct static unsigned long __init ftm_clk_init(struct device_node *np) { - unsigned long freq; + long freq; freq = __ftm_clk_init(np, "ftm-evt-counter-en", "ftm-evt"); if (freq <= 0)