From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 AA0253C1419 for ; Tue, 17 Mar 2026 13:04:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773752674; cv=none; b=s+fkFWRt3dzYXV9dFWb48UKfCRJ2fOpc5h1ql4CWUtkW9w5XgiiEzyOESwRm+q8Q4HK5cTcFrDLSMP3UYyimBU2RnL/DrmV3Z1TXz9tNCugEP7bjCAiey68Pi3Is4Vik7AuqmMHcXCcsGT5QLg7EeWjwqYCJhVkjmKEXt6PnJ/U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773752674; c=relaxed/simple; bh=Oa/csj1srsxV+avME3E5GnkqzSgNadqxhC1xmZPj+0I=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=SlVQckf/ms3os4Gi2X91/UCaMUyrkl/D+uOepkOjLDq6XtKgYafn0eYWoB5Eg7LxqMmoOFQZDJCmlx9MxN7E3WiAfDwd315cH9aZ7ALdHIeWATaOoM+QGnZvHKz4CyUF8YKTuMpfdw5a5LwLm9VgHLfrugkvJA4/wqA5enZoHWA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=XeLqzE8t; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="XeLqzE8t" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C4526C19425; Tue, 17 Mar 2026 13:04:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1773752674; bh=Oa/csj1srsxV+avME3E5GnkqzSgNadqxhC1xmZPj+0I=; h=Subject:To:Cc:From:Date:From; b=XeLqzE8t0w+bKkzWmQ/CA1ypa532a2k0wf7fnWnTo6rBpB5kAmIMp7RuoZt0NxDja 2tUmJmwvmOjcm6gdCvAig52yE4cqn5oK4Zk/o+jMEk/9nqAfNaqcN+f7gpoNOcONO9 0gdeUhu3o/mBg0PmlXR2iYZ/48OIQHzy6WY6Pjgc= Subject: FAILED: patch "[PATCH] iio: buffer: Fix wait_queue not being removed" failed to apply to 6.1-stable tree To: nuno.sa@analog.com,Jonathan.Cameron@huawei.com,Stable@vger.kernel.org,dlechner@baylibre.com Cc: From: Date: Tue, 17 Mar 2026 14:04:30 +0100 Message-ID: <2026031730-control-earplugs-97b6@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.1-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y git checkout FETCH_HEAD git cherry-pick -x 064234044056c93a3719d6893e6e5a26a94a61b6 # git commit -s git send-email --to '' --in-reply-to '2026031730-control-earplugs-97b6@gregkh' --subject-prefix 'PATCH 6.1.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 064234044056c93a3719d6893e6e5a26a94a61b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20S=C3=A1?= Date: Mon, 16 Feb 2026 13:24:27 +0000 Subject: [PATCH] iio: buffer: Fix wait_queue not being removed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the edge case where the IIO device is unregistered while we're buffering, we were directly returning an error without removing the wait queue. Instead, set 'ret' and break out of the loop. Fixes: 9eeee3b0bf19 ("iio: Add output buffer support") Signed-off-by: Nuno Sá Reviewed-by: David Lechner Cc: Signed-off-by: Jonathan Cameron diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c index f15a180dc49e..46f36a6ed271 100644 --- a/drivers/iio/industrialio-buffer.c +++ b/drivers/iio/industrialio-buffer.c @@ -228,8 +228,10 @@ static ssize_t iio_buffer_write(struct file *filp, const char __user *buf, written = 0; add_wait_queue(&rb->pollq, &wait); do { - if (!indio_dev->info) - return -ENODEV; + if (!indio_dev->info) { + ret = -ENODEV; + break; + } if (!iio_buffer_space_available(rb)) { if (signal_pending(current)) {