Received: by 10.192.165.148 with SMTP id m20csp4776745imm; Tue, 1 May 2018 03:43:32 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqWoML47a4poSnpEQcEYW0f/pwljoeUo4Gui1tmkOjE1jRTRx7euPWipqX8tyoDXF5JO8+H X-Received: by 2002:a63:65c4:: with SMTP id z187-v6mr5109944pgb.180.1525171411979; Tue, 01 May 2018 03:43:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525171411; cv=none; d=google.com; s=arc-20160816; b=MeKDppfdoV/dreC2LPfesjF+Gq3fadXVgs0YaCCqaeneDNwF9LLi0wXkg7hCvekv5N +GU1UAbOUbe1Rs8c4waoBL0UbipIUl6gFjGpPSTb3nQpT3+znXHNiF31X4y1ux5PTSHo /xRIM9lL1FX4pBaUUdtxnDMVTapgg7wD/SsumHUfMWQPHrETINJ1H9KRBaFhhfIMrIKb oVDz8C6MdlLLj87qX1L9vE+V36YmMqc1BuKiwlvpa+XvJ4TIZC1WR45K1wVOp20Y8/Z4 h/M5FbjODLocS+eppmt4PTOFhBpiqu+romoZOXLqq/OfLNO6CBV+aptOF3obx7fzvmFQ WiFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=Ugh3WAsdxdgTZOopVyDSvRfKhQCgGA9fkHZfbpW046Q=; b=QK+8q4DMVl8YETXmDfjJ6HVcmn9YMle4URrtY+iv9nrr7olprFgA0SO4Wv0ir/Xhnv kN/eASEox77XLiI9WTJCvhZPUKwQm42b4IIedj8jfcgV5oxcnRBjFHGZlDDe5RxY++k9 WRu1qXXF3Ki8khYg8lqfPWeQqirtbsXd+ZbqrRMiKFNvuWxoIq+OuMphv5aeUIBWQV+0 uiSVDpjGe3a3mlQIYh170AIvr/+lFROhwwS0hG0lxYwnVzFtR7vc1CtuFacQorz+Exso 9efXBoKIpR6BpEJxLMYsJqPCHHMmodTs043jqXMVjyASC6vCbzB0Tio0jC2e8Pw3alo0 C8/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MJHP3nMp; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c20-v6si835244pls.557.2018.05.01.03.43.18; Tue, 01 May 2018 03:43:31 -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=@linaro.org header.s=google header.b=MJHP3nMp; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754446AbeEAKnK (ORCPT + 99 others); Tue, 1 May 2018 06:43:10 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:44027 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753700AbeEAKnI (ORCPT ); Tue, 1 May 2018 06:43:08 -0400 Received: by mail-wr0-f193.google.com with SMTP id v15-v6so10468952wrm.10 for ; Tue, 01 May 2018 03:43:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=Ugh3WAsdxdgTZOopVyDSvRfKhQCgGA9fkHZfbpW046Q=; b=MJHP3nMpIQxHlJhmzDPi31251FyuQtkquIWG/GkvEUEkQ1Hhe7x95TRPCd8KH6/oW6 b/XvDbYAgKKA+GvdE6JJWLnVVodocP5SB+ZvggCCsP5CSTEBLfR30CXX7ATMa+Ss5m46 mL1so4s1Ya9YxxuDHUjosjaDZyXz/mT9VyWO0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=Ugh3WAsdxdgTZOopVyDSvRfKhQCgGA9fkHZfbpW046Q=; b=cM2ZcNDUZLOGVTE5riJ3U3TfnfifvqFReelStfZTzGLHguddOopPEYq2UQxHa5ecx8 aySN8+ACInJoJVoTp6GbR7Ba6gFiVMuuWwpql1kwrx1H/X8dkyZtqjN4yjlYUQ0wf3j4 /6L1Yg3nuB/7J2mMQFoofNqzn6HM9UBKFUySOjypqGKFbySHW323UBwMzv9qjbmU9ODX YD5EOd4wK8g2GSV/Onaed1tfUl38rNMbP0JsmfY043W6h5eUHe0XZHaf47LubNbrKpZj yqSC/zXJl6epKU9LpcBezRE/asn7pTCEDW2sJza7D5hmKQzCkO9GF+syoTdpjwSXhZ02 HVTQ== X-Gm-Message-State: ALQs6tB0RZneRgk7Hy0A5fiduJ84LeElUu+fzK7aji8LnbMCsEsrXPD8 4dwQ3geCbvvsuQ2WnwqyKLLxlA== X-Received: by 2002:adf:b067:: with SMTP id g36-v6mr11184539wra.128.1525171387261; Tue, 01 May 2018 03:43:07 -0700 (PDT) Received: from mai ([37.169.202.92]) by smtp.gmail.com with ESMTPSA id v66sm9532499wmd.4.2018.05.01.03.43.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 May 2018 03:43:06 -0700 (PDT) Date: Tue, 1 May 2018 12:43:04 +0200 From: Daniel Lezcano To: Bartlomiej Zolnierkiewicz Cc: Eduardo Valentin , Zhang Rui , linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 15/18] thermal: exynos: check return values of ->get_trip_[temp,hyst] methods Message-ID: <20180501104304.GL27619@mai> References: <1524743493-28113-1-git-send-email-b.zolnierkie@samsung.com> <1524743493-28113-16-git-send-email-b.zolnierkie@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1524743493-28113-16-git-send-email-b.zolnierkie@samsung.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 26, 2018 at 01:51:30PM +0200, Bartlomiej Zolnierkiewicz wrote: > Check return values of ->get_trip_[temp,hyst] methods in > exynos_tmu_initialize(). > > Signed-off-by: Bartlomiej Zolnierkiewicz > --- > drivers/thermal/samsung/exynos_tmu.c | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c > index 244aaf6..abe0737 100644 > --- a/drivers/thermal/samsung/exynos_tmu.c > +++ b/drivers/thermal/samsung/exynos_tmu.c > @@ -357,19 +357,23 @@ static int exynos_tmu_initialize(struct platform_device *pdev) > /* Write temperature code for rising and falling threshold */ > for (i = 0; i < ntrips; i++) { > /* Write temperature code for rising threshold */ > - tzd->ops->get_trip_temp(tzd, i, &temp); > + ret = tzd->ops->get_trip_temp(tzd, i, &temp); > + if (ret) > + goto err; > temp /= MCELSIUS; > data->tmu_set_trip_temp(data, i, temp); > > /* Write temperature code for falling threshold */ > - tzd->ops->get_trip_hyst(tzd, i, &hyst); > + ret = tzd->ops->get_trip_hyst(tzd, i, &hyst); > + if (ret) > + goto err; Could this fail for 4210 ? > hyst /= MCELSIUS; > data->tmu_set_trip_hyst(data, i, temp, hyst); > } > > data->tmu_clear_irqs(data); > } > - > +err: > clk_disable(data->clk); > mutex_unlock(&data->lock); > if (!IS_ERR(data->clk_sec)) > -- > 1.9.1 > -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog