From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796380952; b=Knl1fzzdYrGzpCMQ1d5TIS5c+ZVMZUvei9ZBzMOg3zyENat8GuQyoSICOng5RRzklIfI mDsghBPTiq5/eeq9W86kcc0iYl4bm7KLL5CdEAK3HAp0HnuKz7CFjEJCrnoJauPxKFeyB H6AWHpdZXuBqHRAYHsjsKHOHcNll741jPMIZmiUNo6X3BJm7c8hwfGgp6BaqBMNpDl+fa SY/IZe3/QcVdfOAot8YZ/wqC9i1Sjg526wPUPmFe4bY1ABuCxry+jp8A/uDP4Kd3eEEYc +WpPpoBLPJhjxWvTmPJA8qjYjI89SlRGzDxcEGL/P95oeXFMhm+XQYkCLMT+6/7ObkQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796380952; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=yA0cMluOlzEQJeIEu/1HvikFhDJBoC43kOiIo16BY5s=; b=t1GS8RypSxSqi+FAw2GTs7cQAqhDddybonu2FjMBInsE9/yMEOx2YcjbE0S1afYb9FZl piTjPgyxFhlrbwuKAWK+jMr+xyb2PcDkCSqDAzwe2LL4wIpSOev7blXjT3FapfHGmnxdy qSH8A49eSo2jG6Kak8utVgnxcwdTvVByv38D7QvmEhTZteTQrO2MmiIFAAJvdn4bmUioz skj2taP1Vn9exEceUXu9837il8dJ3E1+iyP5FQ9fLYVaK5MKoaizlKW/x7Kd0uhZK+yK2 T0ztOtyNFj4BAaoAyqWjxZ4sceWThA7BNrKRyzMAc31UgOdiTIyxdr+tT0Km60wLZQg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=hd00G2be; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 73203606A32D; Fri, 4 Dec 2026 10:42:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=hd00G2be Received: by smtp.kernel.org (Postfix) with ESMTPSA id E54E21F000C2; Fri, 4 Dec 2026 10:42:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796380952; bh=yA0cMluOlzEQJeIEu/1HvikFhDJBoC43kOiIo16BY5s=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=hd00G2bezawceBY1Ty+RLPrJQOiLP848wRcRDV/JhkWMHIwhF2TqDQaSbqnerX3w8 pxdg9qFBr5M/DRakasnctVIBxhFevwnhzjm/w33NSwFi0LYniAAkiZ9KF58RD957Kk hEe7VK9NbENVfEMMVnDVF131d3o4B+3UEj84IsSg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, =?UTF-8?q?V=C3=ADtor=20Hugo=20Silva?= , Guenter Roeck Subject: [PATCH 7.3 496/742] hwmon: (ads7871) Add error handle from spi_setup() Date: Fri, 4 Dec 2026 19:06:00 +0900 Message-ID: <20261204100648.312098080@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 7.3-stable review patch. If anyone has any objections, please let me know. ------------------ From: Vítor Hugo Silva commit 449cdc5e29c63aa66b41ce8c2783f6b0d84c62b0 upstream. The ads7871 probe() ignores the spi_setup() error return value and it attempts to write to registers even if spi_setup() fails. Return the setup error before accessing any registers. AI was used for peer-review the patch. Fixes: e0c70b8078629 ("hwmon: add TI ads7871 a/d converter driver") Cc: stable@vger.kernel.org Signed-off-by: Vítor Hugo Silva Link: https://patch.msgid.link/20261118092928.163553-1-vitorhg20080@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman --- drivers/hwmon/ads7871.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/hwmon/ads7871.c +++ b/drivers/hwmon/ads7871.c @@ -187,7 +187,9 @@ static int ads7871_probe(struct spi_devi /* Configure the SPI bus */ spi->mode = (SPI_MODE_0); spi->bits_per_word = 8; - spi_setup(spi); + ret = spi_setup(spi); + if (ret) + return ret; pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); if (!pdata)