From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44D33C04E87 for ; Wed, 15 May 2019 11:50:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 143BF2053B for ; Wed, 15 May 2019 11:50:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557921025; bh=bm66xKRLhd7zHtRL+0BEHuLQckw6arjnAi9uTkJzrAg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=dnusvUI4CeyEzwc6E7Qd+qeVqJ+c6pfksjk/eUg2kOqe2pR/vNoD+PbC2faJx81UI KDrI4pJ880Y03XlB/ivjjsXaxsjZ3yQ98IPmhMTchB653M44XpXIsEEEZXim3AZ+5K 0ormxCScRH9zLKVtTTsakwSMF5j5OfFWLgtM4NIM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727563AbfEOLuS (ORCPT ); Wed, 15 May 2019 07:50:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:60822 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731458AbfEOLW3 (ORCPT ); Wed, 15 May 2019 07:22:29 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 4A8AF20862; Wed, 15 May 2019 11:22:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557919348; bh=bm66xKRLhd7zHtRL+0BEHuLQckw6arjnAi9uTkJzrAg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YnV8xpLYDLMQ691b5MmnDo4Cwo5/YXVDom+ZdoYtQhdRlhwXq/GyT9ZGUnagr7CFd 7aqtF+s3lvdLndU2yqFp6xBa0ef/p6Puh6ErTw3Ttq8733ZWoQYhDzHwopjCJcQoY8 URXaW7PjWYTHdSQrnUMQMrOk6wM2Ybi59WcicHc0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Guenter Rock , Stefan Wahren Subject: [PATCH 4.19 005/113] hwmon: (pwm-fan) Disable PWM if fetching cooling data fails Date: Wed, 15 May 2019 12:54:56 +0200 Message-Id: <20190515090653.460107239@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190515090652.640988966@linuxfoundation.org> References: <20190515090652.640988966@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Stefan Wahren commit 53f1647da3e8fb3e89066798f0fdc045064d353d upstream. In case pwm_fan_of_get_cooling_data() fails we should disable the PWM just like in the other error cases. Fixes: 2e5219c77183 ("hwmon: (pwm-fan) Read PWM FAN configuration from device tree") Cc: # 4.14+ Reported-by: Guenter Rock Signed-off-by: Stefan Wahren Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman --- drivers/hwmon/pwm-fan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/hwmon/pwm-fan.c +++ b/drivers/hwmon/pwm-fan.c @@ -250,7 +250,7 @@ static int pwm_fan_probe(struct platform ret = pwm_fan_of_get_cooling_data(&pdev->dev, ctx); if (ret) - return ret; + goto err_pwm_disable; ctx->pwm_fan_state = ctx->pwm_fan_max_state; if (IS_ENABLED(CONFIG_THERMAL)) {