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=1796385793; b=u8u/lrGHhT036VjOv3P6ap8uKyNfMGF8kv3/+az/8e3oU9snnWjRtMLZmgnGkyn5U1f0 QvbSPxkxNSFTiQ/a9r+GSD/raPEQNfDRyZ5wJkcf7TxoHbt6WLx8f70kfvmugOKekU6jL Io/qgzjgZQcsPx5O5XSnFDjMHBsGqDvkSiBggZZ/QiXUM3LNWV0NJtnSGCIIkCo/AzWr6 TNz/YvsR9fgowq3a70M867L9FLuLDCNboGkXs2EP9RqYpE5hqGMSwTxx0t1AVoyPeFV/1 h7GveSi0IMARjQo1CQO8O3tXqQo5cXZFuLx7hkEu5dxfMGyTVSG3Oo7K2r+sg4FgoGg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796385793; 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=sGEkrzUTXHFU6qK43ePWWDMzwvDk5X3U6NzWf+MTVE0=; b=3c3vl+FE/Vy7Qx132RS6cxgDHjguQKhIp7InEgYiNsqAfUtx+66NsJQt9/6taeY+CefI FD7LhiUNHLO5cYDiJOJES0r190vkHf2f/ckLEHftY2g7BIJJV3/jLSLtaNlfbrLALReIE /liZ/E6v4oGLwel0pSq2K16XcrDWH//ql0ybJ7eUVIRq74ZB+a/RHcAsS4dl4P6g2NZgA lPN4zj1MRDtJRr1DB3c00+bZ/W8pVJoIOBbCa8v8FQ8bEcV1CGswKT+FrtCLbc+nPDWQh zh11L5abWoygVX5Hs+sJMHeaaJham8z1LcfrMM/8bsz/86NlGUQwEfp58sUKvu2uhvQ== 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=kmfb3ZPj; 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 C74C1606A332; Fri, 4 Dec 2026 12:03:13 +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=kmfb3ZPj Received: by smtp.kernel.org (Postfix) with ESMTPSA id 15F441F000C2; Fri, 4 Dec 2026 12:03:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796385793; bh=sGEkrzUTXHFU6qK43ePWWDMzwvDk5X3U6NzWf+MTVE0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=kmfb3ZPjrvPN42VSf0prSWFtKcNC0Ytsb7ZWnCvDzfsha8YMLIKmazJydg7jE3Vbv Ckb5vZ8AGZXr/MidvuCEXPsh5Tlnj1xAuJ6OKkaGt1EUTGOyxdTeB1HcrmLKpTLdpw ha9IUAR/pHDnuZzhuA7lKxgzzEXrEfXkl4UiiRZM= 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.6 0696/1167] iio: trigger: Return an error when the trigger has no free irq Date: Fri, 4 Dec 2026 19:02:03 +0900 Message-ID: <20261204100720.195293067@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: 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.6-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 @@ -299,6 +299,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; }