Received: by 10.223.164.221 with SMTP id h29csp67486wrb; Fri, 3 Nov 2017 10:35:08 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QuUOUZepUHdzU72BtfHNaSl99oCeXxy7VfA9uXAE7V2s04x9xy0RbPLNjSjIu01wIMSNP1 X-Received: by 10.99.108.2 with SMTP id h2mr7915062pgc.362.1509730507888; Fri, 03 Nov 2017 10:35:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509730507; cv=none; d=google.com; s=arc-20160816; b=md/yusMV9/iO/ZCJBVuD1RVuF68GSdvZRRgkG1OlbQw6auPnF4CF5HR0HV8siZNxnB Yhx8tNr/2eSBYPa9QZvSfre1Y5moQPMVLff/12MWV8cR0ehgMbzfpW+IGFdI9nrfG1hd NsO+WTdloCyAZzF4+kzp6269amBit8wBTh0w7sL/fBaOOsWEEJVLXBKUuyoiY+EUrlkW aDcSXGelA7RUO9r19orT1jwjCNkHAWvMUxIZN/25cvU6/4grKU2uBmEjNnAoHzZ3fPTG vIMTiGDhxvslgYBnbfcE5Zpz2LGrtLa6HYq9jIcn+xIbTJFxPYDfZ+Bq/1QSd1dj4r36 FtHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=E5A7WXLf3Apn9Ki3RuoxUyrxpZH5lFjznybiPlz6gCQ=; b=ODf6G7FZMEwrhjXfiDHI3j63ERtnZPj9s4hRz57ZAB23B5ukqjk/Dx2rObHgOPxtHg VLiZiHXs7Gp/nDz2Kie3CQvJvTqi32JR07ykyDH288EzbZRar/HVIMmFSgunoxTb1gvE n6C3c+fGB4ASAQ0tS01mjbOlRcnhW+rziWHWBjrSFK4I52nkYwv54KtCCJ5E5w5ThWGk gah261BaAVVLyrN3EUBNY/Db0DI4gCOWxOfNLLSEeygUVSkExpCEjN9pzjf8OBXwCsAx i4eGIBUhK23LOI9cQqZm3QZBLefFXqwpXShID19tsHZTFMi0LGJM04xzvD0lmBIicN0L Bb6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@timesys-com.20150623.gappssmtp.com header.s=20150623 header.b=MJ4KWK8x; 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 o28si6375252pgc.521.2017.11.03.10.34.55; Fri, 03 Nov 2017 10:35:07 -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=@timesys-com.20150623.gappssmtp.com header.s=20150623 header.b=MJ4KWK8x; 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 S1756446AbdKCRdr (ORCPT + 93 others); Fri, 3 Nov 2017 13:33:47 -0400 Received: from mail-qt0-f196.google.com ([209.85.216.196]:56133 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756415AbdKCRdo (ORCPT ); Fri, 3 Nov 2017 13:33:44 -0400 Received: by mail-qt0-f196.google.com with SMTP id v41so4111250qtv.12 for ; Fri, 03 Nov 2017 10:33:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=timesys-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=E5A7WXLf3Apn9Ki3RuoxUyrxpZH5lFjznybiPlz6gCQ=; b=MJ4KWK8x5UAi8HcscLdahzR3aSghggJtaO7NPVJ0hgN0hk4Uf2A5SoIUjYjJ95FTn/ 7PqlghGmKGesLFFyLip4jYWWAKhHLtmCyZBRgzjvs+2VAfuBPT2X/puM21N4nEifIKRi yPBIiecwV4dVmWphO74+dwU/7p3V2yD2YvOCR9hTq8NFJWKJMKJrDnzh3b7M/q/qg0+o 3vjomJ1Q6VDctOtafqw2tUzdMX9L13M9GG1GV3CfIQL9TdPzLIqdCBlOBTvD9kkaM0I5 xO7ov49+j9HK3zQcdu1IffP5CQl9WMh+x20G0ivjx+dV/ZlrrUVcy6JZgYVve8XsNl2Y NgYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=E5A7WXLf3Apn9Ki3RuoxUyrxpZH5lFjznybiPlz6gCQ=; b=alRbDQEx4mmvEtf4OF48Zl6qtYlxkNAn5nS3QCJKPZwmayHtbDBRkEdQitVcg347/N VHp92O38jUE22HXDvKxclemgkfUaRnU38TKLh4fL72eJCKWuo+9unwUYdSS6ItDC35dN B+9qPqXWFtFCLnDACy8/0mMu48MKB9ZCV+mmiMVKUrJDgyvbRcAAHbxtoZInscEXOFob EUUCBaJIBeSVivQSfU9U0uSnR4uKSyFYow2ehMUikwCruUHKD+Jv4iYSDGfd67zvCDhv 2+E6LVzghpChmn7svtMnOd9Vm6qrlkZRmZyFv0ZATlHfNNhNHcntEMEsMsnGRHd90ar3 yVkw== X-Gm-Message-State: AMCzsaXOtNYNGarAlBuDFYieUVCQ7oYsiqV2wG6MmNPUkxSy/m/MhEEz TsNdtzOZN4SWUvKDQWN5yGSZ7A== X-Received: by 10.200.42.11 with SMTP id k11mr11569005qtk.273.1509730424066; Fri, 03 Nov 2017 10:33:44 -0700 (PDT) Received: from timesysax.timesys.com (96-94-100-129-static.hfc.comcastbusiness.net. [96.94.100.129]) by smtp.gmail.com with ESMTPSA id n131sm4161188qke.48.2017.11.03.10.33.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 03 Nov 2017 10:33:43 -0700 (PDT) From: Akshay Bhat To: a.zummo@towertech.it, alexandre.belloni@free-electrons.com Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, Akshay Bhat Subject: [PATCH 3/3] rtc: rx8010: Fix for incorrect return value Date: Fri, 3 Nov 2017 13:32:41 -0400 Message-Id: <1509730361-23905-3-git-send-email-akshay.bhat@timesys.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1509730361-23905-1-git-send-email-akshay.bhat@timesys.com> References: <1509730361-23905-1-git-send-email-akshay.bhat@timesys.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The err variable is not being reset after a successful read. Explicitly reset err variable to account for all return paths. Reported-by: Jens-Peter Oswald Signed-off-by: Akshay Bhat --- drivers/rtc/rtc-rx8010.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/rtc/rtc-rx8010.c b/drivers/rtc/rtc-rx8010.c index 2e06e5f..1ce2078 100644 --- a/drivers/rtc/rtc-rx8010.c +++ b/drivers/rtc/rtc-rx8010.c @@ -223,6 +223,7 @@ static int rx8010_init_client(struct i2c_client *client) 2, ctrl); if (err != 2) return err < 0 ? err : -EIO; + err = 0; if (ctrl[0] & RX8010_FLAG_VLF) dev_warn(&client->dev, "Frequency stop was detected\n"); @@ -261,6 +262,7 @@ static int rx8010_read_alarm(struct device *dev, struct rtc_wkalrm *t) err = i2c_smbus_read_i2c_block_data(client, RX8010_ALMIN, 3, alarmvals); if (err != 3) return err < 0 ? err : -EIO; + err = 0; flagreg = i2c_smbus_read_byte_data(client, RX8010_FLAG); if (flagreg < 0) -- 2.7.4 From 1583540152874593544@xxx Wed Nov 08 22:52:52 +0000 2017 X-GM-THRID: 1583459787602160527 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread