From patchwork Fri Jul 4 01:22:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hyogi Gim X-Patchwork-Id: 33063 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f70.google.com (mail-oa0-f70.google.com [209.85.219.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 22184203AC for ; Fri, 4 Jul 2014 01:23:29 +0000 (UTC) Received: by mail-oa0-f70.google.com with SMTP id m1sf5096441oag.9 for ; Thu, 03 Jul 2014 18:23:28 -0700 (PDT) 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=KZNQdr6v45/5aWfNhLToprT1y02EqlDxmQf3gqz+hsY=; b=lhLJQdM64vO37YKFJmdKu8la47caoE2y3VhCv5/GN69SDtzJdlOftrBsTIucxKvjXC PrbtrIrORqtYn/xov743eYij3bCRG2vs+1MCVuM0hHA+xRPHojeljPhviRB79Y/N9aMk VkQVFPD6rqxj10mR0HlFMEeYMN31APXp6rech2N6HOaTXJ6Gngd3PDCrlGdkpLQgILc2 WZy18OmRZ3Q7mv9XtXtpsseJQS4PTvcfJVYse9YhyLpx2WdL7ooOTaY6CRRvA6XbiNQP Hy7dIUniqTBGlgJU/C2+CVXOXlsbZzEM0G//8IrPIw+NVyIpgG82BR/6yJVC6slbrWHw dOGQ== X-Gm-Message-State: ALoCoQn5HpEUdmZJHZaHmDs3nSpW7CV1UP5oHOBnRd0YPy0lXem/hELq9m7787IO4SnNirVczvKo X-Received: by 10.50.164.202 with SMTP id ys10mr7144184igb.0.1404437008926; Thu, 03 Jul 2014 18:23:28 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.96.201 with SMTP id k67ls742155qge.22.gmail; Thu, 03 Jul 2014 18:23:28 -0700 (PDT) X-Received: by 10.58.228.74 with SMTP id sg10mr6638977vec.6.1404437008795; Thu, 03 Jul 2014 18:23:28 -0700 (PDT) Received: from mail-ve0-f172.google.com (mail-ve0-f172.google.com [209.85.128.172]) by mx.google.com with ESMTPS id k14si13132301vdg.49.2014.07.03.18.23.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 03 Jul 2014 18:23:28 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.172 as permitted sender) client-ip=209.85.128.172; Received: by mail-ve0-f172.google.com with SMTP id jz11so1035650veb.31 for ; Thu, 03 Jul 2014 18:23:28 -0700 (PDT) X-Received: by 10.53.7.204 with SMTP id de12mr124271vdd.41.1404437008677; Thu, 03 Jul 2014 18:23:28 -0700 (PDT) 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.221.37.5 with SMTP id tc5csp425853vcb; Thu, 3 Jul 2014 18:23:28 -0700 (PDT) X-Received: by 10.70.134.193 with SMTP id pm1mr7158858pdb.117.1404437007728; Thu, 03 Jul 2014 18:23:27 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id wk8si34143859pbc.46.2014.07.03.18.23.27; Thu, 03 Jul 2014 18:23:27 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755928AbaGDBXQ (ORCPT + 27 others); Thu, 3 Jul 2014 21:23:16 -0400 Received: from LGEMRELSE7Q.lge.com ([156.147.1.151]:57016 "EHLO lgemrelse7q.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751850AbaGDBXP (ORCPT ); Thu, 3 Jul 2014 21:23:15 -0400 Received: from unknown (HELO localhost.localdomain) (165.186.175.61) by 156.147.1.151 with ESMTP; 4 Jul 2014 10:23:07 +0900 X-Original-SENDERIP: 165.186.175.61 X-Original-MAILFROM: hyogi.gim@lge.com From: Hyogi Gim To: Alessandro Zummo , John Stultz Cc: rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org, Hyogi Gim Subject: [PATCH] drivers/rtc/interface.c: check the error after __rtc_read_time() Date: Fri, 4 Jul 2014 10:22:26 +0900 Message-Id: <1404436946-28354-1-git-send-email-hyogi.gim@lge.com> X-Mailer: git-send-email 1.8.3.2 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: hyogi.gim@lge.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.172 as permitted sender) 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: , In __rtc_set_alarm(), the error after __rtc_read_time() is not checked. If rtc device fail to read time, we cannot guarantee the following process. Add the verification code for returned __rtc_read_time() error. Signed-off-by: Hyogi Gim --- drivers/rtc/interface.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c index 5813fa5..5b2717f 100644 --- a/drivers/rtc/interface.c +++ b/drivers/rtc/interface.c @@ -348,6 +348,8 @@ static int __rtc_set_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm) /* Make sure we're not setting alarms in the past */ err = __rtc_read_time(rtc, &tm); + if (err) + return err; rtc_tm_to_time(&tm, &now); if (scheduled <= now) return -ETIME;