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=1796386374; b=DLU54xQ3E6IYp3vmKbMJ/SapBgefvx1JRt/npwARQJsGo1Z7whQRNSCATp1bu+7vHsAw w2RYuqcbFObBZvljpNGvg6OojRZnuunri/1yQgRxoEVVHCeBbdXv6hdgLyoKQJ3fLM8F0 tr+3PiIVg/GT5iwyVwd++4TAhd0kPDiPu/3yODmaAZqeg5ZKel9CnKEU9QdtMxKynhsW6 b5lwO5fGuveJyFjT8Sccfwi+J7e87be291pSBYT5Rh/4JxKshkIXmpt07TBph+yDSX6nT 6Dkn0bCE/Y6on0hyE+voATVVx7oealQvpbN2FOva4/Lw4GSs8oOx7U9jDk3oMKXlvhw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796386374; 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-Transfer-Encoding; bh=OgTsC0IGEi6zCyW7aCKMSKqWMlpXNqcH/IHwQBjaob8=; b=0vv0RoKSU8IbDHebZpdZbzsvHfE6XcNLTwE3c32ug4B1NUXlPPPazw1NG8YMzAI+KrAV zXkU0pS/uWRlB2OwrLI6SKjSwrT5+P3RO0DYZmCEdJbJaz6GpHt03KIEbO/ynRc7ihxhb 9VJs3DNvlSzgZXGBzHSNeCMKM5BB4UJ01nDIH3nYzI0UECpnswnd+aPRJ6BUhdcZ+zgEd PBkzPXdNJrbRNrse6x6fdDHM0CAy0bSdMt4jyg8274A0/cHAjZ3Ps942l7g7wSOaxVax+ gt19bKSRAb/lOPALkugQDjW9JJy5m/Q1E+LasOHXw0MX4cpJiSys0nriS9bsmL2+ztw== 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=CInbEslb; 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 6775C606A333; Fri, 4 Dec 2026 12:12:54 +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=CInbEslb Received: by smtp.kernel.org (Postfix) with ESMTPSA id 613651F00933; Fri, 4 Dec 2026 12:12:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796386373; bh=OgTsC0IGEi6zCyW7aCKMSKqWMlpXNqcH/IHwQBjaob8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=CInbEslb2nyrzjxNJxPnlpIIUezHT3EkhVWRgHSIi/R2ocGfwF0p6S8qfW4CY5YNp 5Ufp4D+AsRzGODeGV6z0EGZ4kzCGqds7cXbUpP/vAnZj/ccJIPVnaN6TFHTvPqAzs9 WAh5jlsZa2/X+U4p/60QGKw9U6spHsk0lRlRTSPg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Zhu Jun , Bartosz Golaszewski , Sasha Levin Subject: [PATCH 6.6 0933/1167] tools: gpio-hammer: Accept the maximum number of line offsets Date: Fri, 4 Dec 2026 19:06:00 +0900 Message-ID: <20261204100726.495311084@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Zhu Jun [ Upstream commit 0b3f1876d6db7fad0391ce714b315269b0dd5758 ] The offset count is incremented for every -o option, but the final check rejects the maximum itself and reports one extra offset. Only reject counts above the maximum and report the actual count. Fixes: d1ee7e1f5c91 ("tools: gpio-hammer: Avoid potential overflow in main") Signed-off-by: Zhu Jun Link: https://patch.msgid.link/20261120061827.98066-1-zhujun2@cmss.chinamobile.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Sasha Levin --- tools/gpio/gpio-hammer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/gpio/gpio-hammer.c b/tools/gpio/gpio-hammer.c index 54fdf59dd320d..62d346b67d46e 100644 --- a/tools/gpio/gpio-hammer.c +++ b/tools/gpio/gpio-hammer.c @@ -159,10 +159,10 @@ int main(int argc, char **argv) } } - if (i >= GPIOHANDLES_MAX) { + if (i > GPIOHANDLES_MAX) { fprintf(stderr, "Only %d occurrences of '-o' are allowed, %d were found\n", - GPIOHANDLES_MAX, i + 1); + GPIOHANDLES_MAX, i); return -1; } -- 2.53.0