Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp467944yba; Wed, 15 May 2019 04:38:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqxPdBMugiFUN/YZibY1QTceh4UHmWWgr9NAWB6JMDriTsSh7Bdkc/GpUvkv7B90jGGJ6JAV X-Received: by 2002:a62:b508:: with SMTP id y8mr46838762pfe.113.1557920335423; Wed, 15 May 2019 04:38:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557920335; cv=none; d=google.com; s=arc-20160816; b=rgQhdd9vyTN8NlfFPgl7EaPqRSkfvp08WcrLLddpy1/5XanGjeE+wEyFUQVaoUsqoH p8WZ0bDzeMSbLnZagUIy2lbXnukhdR1khGpOEI+adOWVMXIcCxmCKDOqbbJVDXV08UUi n8EumeBYlX6pFudUCESXbX+wZzLvvm1YyXKLOsDsgsln465VFlHeNOBRx1x+98nsu9yO BGDeE+YZjxicI3HEl6+m2BcB9/ECMxrj8IonZiCMN14z4xoasy0X3xWgaQbwtAD3sqSm V8E5JasV0mXuUaYPCgfkCoi7yGE3//obL5dzpYxQiezF8uvQIJUY1qYkfj9osafU3bEv oj+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zTmRt3fN31sFcpu5y5t/hY0TIzvdQ/rBpIaagilIAWo=; b=TFmP3DaKjYi+KL9AANL52ozwQE43aiFleiJMYuoI4dNIF39MkxGFLrlE3r3WOM7sf+ jWZuMWEx2L4Ik1Ha610by1uR3iOZiyVmylnzu1KQTbYuDe+65CdktFRh7Tt6Vm8qGUeC dCKcma35qfnft1MXpLoW0c9n5oV9goPRQ6IKhs5PM2jKpUiM2DX/8Lx6QagBhyIwK5CZ 0R97XqjGCnY4N2km3YExxekSPFcV89GQyHXsAnEcSOKHgBZXiqlQ3n+8wo0xa9IoVD2e hgBMBYN1pQqLI+tnCxOxz08ECH74twu4mvYT09xcrYfzjCaVVDHnM1ta/E/jLF+T2bPN Op/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=C0tYWMNX; 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 36si1655105pgx.477.2019.05.15.04.38.41; Wed, 15 May 2019 04:38:55 -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=C0tYWMNX; 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 S1733184AbfEOLdX (ORCPT + 99 others); Wed, 15 May 2019 07:33:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:45254 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733176AbfEOLdU (ORCPT ); Wed, 15 May 2019 07:33:20 -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 2965D2084A; Wed, 15 May 2019 11:33:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557919999; bh=U+bVO08RSkFhXJCb1d6WIQYF9KG8SlPWxmTuRrDvIx0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C0tYWMNXAOBKku63FGGQxvK3vopt2wbyvIghiU6enAzbCoW5Tcn3/teUYCFXwErWz PYsoFVb381RaK+I2HNt+ddz38AJv4GUHcE78IdfLJIK/bhrWijnILpol7KRmpwh92p pxt/2zkcmvFEkUoQhcnzpL+cGPwdblVe7zaufnf0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Guenter Rock , Stefan Wahren Subject: [PATCH 5.1 04/46] hwmon: (pwm-fan) Disable PWM if fetching cooling data fails Date: Wed, 15 May 2019 12:56:28 +0200 Message-Id: <20190515090619.129811625@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190515090616.670410738@linuxfoundation.org> References: <20190515090616.670410738@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 @@ -271,7 +271,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)) {