Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2752960pxj; Mon, 31 May 2021 09:52:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQyMeW4oT8p5rpDLpirNhwHNyPfT3PkBY2pbEtgES7zvX2DKmTknyOyr8JUbSo41A84AoT X-Received: by 2002:a17:906:5210:: with SMTP id g16mr24030068ejm.116.1622479953022; Mon, 31 May 2021 09:52:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622479953; cv=none; d=google.com; s=arc-20160816; b=TDM4r12Ym0NxNPkaMbXJ8zq4SG3J1ekPdHQeUdi1tFfiUN7DRd6i+uj/6WGxYHsdCj IcU3XvGyxvb6onG98qDwu5fKRXwrpqp0bYYkfUe+M2psFz2oD+oXVmarGMNSdtY6toRi mlxYqFp8pD5naj2rmFV/Ra375kSgBFNMoNTN0dv2WyattqWmVBGYgIrVxfbue1Dd9mCw GHYAaTYxMgPgoq54BjNVLrktOOGdk5DKiv+fECJtna706NasVRW8AQ3mt9l8d6vq14Pv kOYMR/p3W+LF8mQWxKt1jM8PM3Mfk3znKgOJ1fkdckk9iJs/VRXWRm0eMtSZSSNmBMs6 3ORg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Rv7ekCWLOymGLFcJdOJvK5Kkc5JoKX1zcB9b20vmNMg=; b=jIb1u7IaBCwaCX8E5Hy2vxo90PsBwCCiuzUk4jM1W2OqBhkASojR9l3As/Xc1htlRv 4BAYxMuObAWFFyYYt53CiKJ8R7qsOe2PVWQvCRxNqyYtoY6oV3KVyF1W52bD4U6rCjm9 T4XUVYkBlFpdC5gHlacYj3AiLjUaElHACSTkdYIzW7cuu5JrRKyzhetV2TOTS3TaqsU7 zWXRstSMGXJ2D9B/QOTAa97sUnPmkWs6gHMLmJvmoWwbR1RJuSH0AJYl8Y0AodVtH92W T/EI1TSENP3NgKc3YeZOVj8nq2FLtrQ7ksPp4XbAX/B38ahkNkPTagBiftmdUJ2Gij4+ FAjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Xz0O7K2t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cb18si5869719edb.80.2021.05.31.09.52.09; Mon, 31 May 2021 09:52:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Xz0O7K2t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232834AbhEaQwj (ORCPT + 99 others); Mon, 31 May 2021 12:52:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:50542 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234450AbhEaO7o (ORCPT ); Mon, 31 May 2021 10:59:44 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 646F660FDA; Mon, 31 May 2021 14:01:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622469699; bh=fSTD4FuGqLEfK8x+eTDVG+Dp7DHSuice4wy0O09xT3g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xz0O7K2tUr6Y7vnd+CL8WhktnTOoxHPCVenpnExmkcZmn1FAgNgubmnGIGEbX+frx Kp4avAFG4KjgcOoU4OhdWBy06SptDadAcaQLmqGPudug34pq/l7lf8w6ikwFMuvVUk Cu/Pl8JqsvRTEh/wLJvNRDuGaZIKUk6JdG9bv9vg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Yang Yingliang , Daniel Lezcano , Sasha Levin Subject: [PATCH 5.12 286/296] thermal/drivers/qcom: Fix error code in adc_tm5_get_dt_channel_data() Date: Mon, 31 May 2021 15:15:41 +0200 Message-Id: <20210531130713.331981212@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130703.762129381@linuxfoundation.org> References: <20210531130703.762129381@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yang Yingliang [ Upstream commit 5d8db38ad7660e4d78f4e2a63f14336f31f07a63 ] Return -EINVAL when args is invalid instead of 'ret' which is set to zero by a previous successful call to a function. Fixes: ca66dca5eda6 ("thermal: qcom: add support for adc-tm5 PMIC thermal monitor") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20210527092640.2070555-1-yangyingliang@huawei.com Signed-off-by: Sasha Levin --- drivers/thermal/qcom/qcom-spmi-adc-tm5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/thermal/qcom/qcom-spmi-adc-tm5.c b/drivers/thermal/qcom/qcom-spmi-adc-tm5.c index b460b56e981c..232fd0b33325 100644 --- a/drivers/thermal/qcom/qcom-spmi-adc-tm5.c +++ b/drivers/thermal/qcom/qcom-spmi-adc-tm5.c @@ -441,7 +441,7 @@ static int adc_tm5_get_dt_channel_data(struct adc_tm5_chip *adc_tm, if (args.args_count != 1 || args.args[0] >= ADC5_MAX_CHANNEL) { dev_err(dev, "%s: invalid ADC channel number %d\n", name, chan); - return ret; + return -EINVAL; } channel->adc_channel = args.args[0]; -- 2.30.2