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=1796388502; b=CBW2BQh+CQc2yaYCVVss49s7x9TZ2ci03nQRg0Nyvwz9LmxbWyg12nv/cNcbJu6wzqia atFl/eBZSp2NFqx7SaTN3jUmKTZ2tJYkGTMgjqn39qfwWG/aHHMYc3aNiL9/gpMc4bIA5 1HoadVdEVnACF53jCtyNyDB/Xm3VX2uYyEAjkySxAPXinSCH3Yzspd/6zer8XjU63PxE9 8p1Ewd49jxdbJEJ0K6rLCSCZuO5kKhs3kqfoUiSyjlew/6r/rrRfh6SQe6iBnsSZ23bMg Ue/lYb7MW1dZ5lJiybMePk29pkMDpc3rmbnELsXbi7KvJGYIprc2kPnQs4n+qmti6dw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796388502; 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=wOF1eZdy+H5DUWWi6lyX11mkrA7mKbD5kUBf2lczkN4=; b=NnDQbxpca3zOV6ePgRco34wQhchGXz7HB4rgIhk6HO7Hpbt9BHHKfP2OxJjQyUhuZ6zZ AprUGa4PEhQHo1YIeROeNNJAQh0es0n4ecw5Sgrb9Lqo9SmETTRZPutWmJG15hv5R52II yrX2Ux6XupwJM7D7FOPz6TJgrx92dOdJLaVNEJCVh4Dr+MFklakXsDnS9rHGECFIaSYOJ +qGDbWkn9I0R+LWBRRjU8hgpqbO0AlJUsKbpLcLWjSJZIyBpNMIhErE2rr3o75JNs+v4n Wl96QreSdtpjr84XwGhPtWxqirhdCyUdIDCvcHjgGeG5S1D037N6dOmFj6vdtWc7yAA== 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=udPAobPQ; 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 DD43A606A681; Fri, 4 Dec 2026 12:48:22 +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=udPAobPQ Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59F041F000C2; Fri, 4 Dec 2026 12:48:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796388502; bh=wOF1eZdy+H5DUWWi6lyX11mkrA7mKbD5kUBf2lczkN4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=udPAobPQYkhmEMA5S4R77+tWr3oA1pRdD4c6iLkrRXCPIDjOSa+AYILQ2XbXmvxhG +hy3GGzuU+q5dg95DhOex/7Oek0jCTqJZCNzWlNUMwzsCYYeFelHO8P57N0aekTMDO 20E/HDmsvn2gezkaQ74m9rtGFV6hiATbgeI9UuyQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Karl Mehltretter , Joshua Crofts , Jonathan Cameron Subject: [PATCH 6.1 0642/1059] iio: trigger: Return an error when the trigger has no free irq Date: Fri, 4 Dec 2026 19:02:53 +0900 Message-ID: <20261204100700.701891797@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@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-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Karl Mehltretter commit dff701806ab6252f6a0fccba880c47cd09602625 upstream. iio_trigger_attach_poll_func() prints an error when all CONFIG_IIO_CONSUMERS_PER_TRIGGER irqs of the trigger are in use, but returns 0. The buffer of the extra consumer is enabled without a poll function. Disabling that buffer calls clear_bit() with a negative bit number and drops a module reference for the second time. On arm and arm64 the clear_bit() goes about 512 MB past the pool bitmap. That is an oops if the address is not mapped, and a bit cleared in unrelated memory if it is. Return the error from iio_trigger_get_irq(). Fixes: 995438233579 ("iio: Fix error handling in iio_trigger_attach_poll_func") Cc: stable@vger.kernel.org Signed-off-by: Karl Mehltretter Reviewed-by: Joshua Crofts Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/industrialio-trigger.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/iio/industrialio-trigger.c +++ b/drivers/iio/industrialio-trigger.c @@ -286,6 +286,7 @@ int iio_trigger_attach_poll_func(struct if (pf->irq < 0) { pr_err("Could not find an available irq for trigger %s, CONFIG_IIO_CONSUMERS_PER_TRIGGER=%d limit might be exceeded\n", trig->name, CONFIG_IIO_CONSUMERS_PER_TRIGGER); + ret = pf->irq; goto out_put_module; }