From nobody Sun Feb 8 15:25:54 2026 Received: from mx12.kaspersky-labs.com (mx12.kaspersky-labs.com [91.103.66.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EC76423C8C7; Fri, 14 Nov 2025 15:13:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.103.66.155 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763133213; cv=none; b=NKl873anMzcPh1gPN7cqtG9jpJ5B8c1Jh1ijDuvSMEdFhnAHa8tWKEUde10ykKJAGbH7ZFQMhn+tjzJ0zTRAkTujLd75hM+z+QwhR6hdQ2fLIMltSNOL1ZTzoDcmF+18Oihg2jBrEG7229/9FeyGWBvy4m1SpSbv62x8ME337MI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763133213; c=relaxed/simple; bh=YqkPVmpDk2fSDnlwhZMK0gPFa2MKjyVSjtXITuXKuKc=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=MHGNenmbmUqReh++tKm568BD5roHwb6UBMBtd1FcYbY4odIVpHsxZ4JNR2YM9sM5xUjeEfQCi9GoNnp+9xLXrk6LE1WFvj/28G+rr7dX65v0r9yIxmK7SPF2VrH2qULl8TAGZHA+j9hl3BCZ3IE+6X5mnc7arzFIauJrJciIE8Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=kaspersky.com; spf=pass smtp.mailfrom=kaspersky.com; dkim=pass (2048-bit key) header.d=kaspersky.com header.i=@kaspersky.com header.b=cS2A43bV; arc=none smtp.client-ip=91.103.66.155 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=kaspersky.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kaspersky.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kaspersky.com header.i=@kaspersky.com header.b="cS2A43bV" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kaspersky.com; s=mail202505; t=1763133201; bh=53yxrozI3CF/mq6hkWqgfKTmUqtBzQ0Rcjlnyy5wc5w=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=cS2A43bVo17uwPo5mJiX2Gnu9cQaGK8WW/4PpzP2FmN86wv8JE6/VUoOrTl1y9r/X upPRgDwMwkyXBkaOxAp0YkOZaoJJIyM/Fu9jfJMXJ6nWQJ4zLAvRDrlu+J0hz1L5i/ uyxP66Vy+oGe9mbHVbFHjBQZ4eEynCV2GAH9hLPM8iCDXdutPCTwO4ekqXWWua6mWs ipvoTLM0LQVDLuJFsIyXBKtkJdKTXQ8AR/RHWIJwgSiw8hYeBzC4Zxjh6QJLG3hnKn oS00233quCdVmRt3URR/fAYJiSBN1PR2z4HwEKNeklaZwDy4He/xMkd/kHeHMKQ899 jjTY/2UtX/pDg== Received: from relay12.kaspersky-labs.com (localhost [127.0.0.1]) by relay12.kaspersky-labs.com (Postfix) with ESMTP id CFA725A180B; Fri, 14 Nov 2025 18:13:21 +0300 (MSK) Received: from mail-hq2.kaspersky.com (unknown [91.103.66.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail-hq2.kaspersky.com", Issuer "Kaspersky MailRelays CA G3" (verified OK)) by mailhub12.kaspersky-labs.com (Postfix) with ESMTPS id E416F5A5483; Fri, 14 Nov 2025 18:13:20 +0300 (MSK) Received: from zhigulin-p.avp.ru (10.16.104.190) by HQMAILSRV2.avp.ru (10.64.57.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.29; Fri, 14 Nov 2025 18:13:03 +0300 From: Pavel Zhigulin To: Lars-Peter Clausen CC: Pavel Zhigulin , Michael Hennerich , Jonathan Cameron , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Greg Kroah-Hartman , , , Subject: [PATCH] iio: adc: ad7280a: handle spi_setup() errors in probe() Date: Fri, 14 Nov 2025 18:13:01 +0300 Message-ID: <20251114151302.2255348-1-Pavel.Zhigulin@kaspersky.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: HQMAILSRV4.avp.ru (10.64.57.54) To HQMAILSRV2.avp.ru (10.64.57.52) X-KSE-ServerInfo: HQMAILSRV2.avp.ru, 9 X-KSE-AntiSpam-Interceptor-Info: scan successful X-KSE-AntiSpam-Version: 6.1.1, Database issued on: 11/14/2025 14:58:55 X-KSE-AntiSpam-Status: KAS_STATUS_NOT_DETECTED X-KSE-AntiSpam-Method: none X-KSE-AntiSpam-Rate: 0 X-KSE-AntiSpam-Info: Lua profiles 198109 [Nov 14 2025] X-KSE-AntiSpam-Info: Version: 6.1.1.11 X-KSE-AntiSpam-Info: Envelope from: Pavel.Zhigulin@kaspersky.com X-KSE-AntiSpam-Info: LuaCore: 76 0.3.76 6aad6e32ec76b30ee13ccddeafeaa4d1732eef15 X-KSE-AntiSpam-Info: {Tracking_cluster_exceptions} X-KSE-AntiSpam-Info: {Tracking_real_kaspersky_domains} X-KSE-AntiSpam-Info: {Tracking_uf_ne_domains} X-KSE-AntiSpam-Info: {Tracking_from_domain_doesnt_match_to} X-KSE-AntiSpam-Info: zhigulin-p.avp.ru:7.1.1,5.0.1;kaspersky.com:7.1.1,5.0.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;127.0.0.199:7.1.2 X-KSE-AntiSpam-Info: {Tracking_white_helo} X-KSE-AntiSpam-Info: FromAlignment: s X-KSE-AntiSpam-Info: Rate: 0 X-KSE-AntiSpam-Info: Status: not_detected X-KSE-AntiSpam-Info: Method: none X-KSE-Antiphishing-Info: Clean X-KSE-Antiphishing-ScanningType: Deterministic X-KSE-Antiphishing-Method: None X-KSE-Antiphishing-Bases: 11/14/2025 15:01:00 X-KSE-AttachmentFiltering-Interceptor-Info: no applicable attachment filtering rules found X-KSE-Antivirus-Interceptor-Info: scan successful X-KSE-Antivirus-Info: Clean, bases: 11/14/2025 2:08:00 PM X-KSE-BulkMessagesFiltering-Scan-Result: InTheLimit X-KSE-AttachmentFiltering-Interceptor-Info: no applicable attachment filtering rules found X-KSE-BulkMessagesFiltering-Scan-Result: InTheLimit X-KSMG-AntiPhishing: NotDetected X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.1.1.8310, bases: 2025/11/14 12:42:00 #27925085 X-KSMG-AntiVirus-Status: NotDetected, skipped X-KSMG-LinksScanning: NotDetected X-KSMG-Message-Action: skipped X-KSMG-Rule-ID: 52 Content-Type: text/plain; charset="utf-8" The probe() function ignored the return value of spi_setup(), leaving SPI configuration failures undetected. If spi_setup() fails, the driver should stop initialization and propagate the error to the caller. Add proper error handling: check the return value of spi_setup() and return it on failure. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 2051f25d2a26 ("iio: adc: New driver for AD7280A Lithium Ion Battery = Monitoring System") Signed-off-by: Pavel Zhigulin Reviewed-by: Marcelo Schmitt --- drivers/iio/adc/ad7280a.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/iio/adc/ad7280a.c b/drivers/iio/adc/ad7280a.c index dda2986ccda0..63fceb239bd8 100644 --- a/drivers/iio/adc/ad7280a.c +++ b/drivers/iio/adc/ad7280a.c @@ -1024,7 +1024,9 @@ static int ad7280_probe(struct spi_device *spi) st->spi->max_speed_hz =3D AD7280A_MAX_SPI_CLK_HZ; st->spi->mode =3D SPI_MODE_1; - spi_setup(st->spi); + ret =3D spi_setup(st->spi); + if (ret < 0) + return ret; st->ctrl_lb =3D FIELD_PREP(AD7280A_CTRL_LB_ACQ_TIME_MSK, st->acquisition_= time) | FIELD_PREP(AD7280A_CTRL_LB_THERMISTOR_MSK, st->thermistor_term_en); -- 2.43.0