From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 C38A931F9AC; Sun, 7 Jun 2026 10:44:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780829095; cv=none; b=APnvs+HJfIqga9LW/sncbZNnXpAWVTBmPVKqw/pFEXu7z1bUHN9Zv3i+sSCaaJoGpcFdZNnF6Lxa/Tz+XgBUHUaERR6gJzyW+6GWbEMlq/xXjqGTxz33/t7QTkrJh2Gz4ypwmdQaZP/M4AY+WCNbtf8UH2MhplMo9allzcSHOeo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780829095; c=relaxed/simple; bh=zDkvQa9HCM32t+ih2wMrC9KwbRp64ZkD9vnZLEFUfS4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sdOQvYpyK6glq1ozaOfpCmlfcVEvEjS5RyERlv41qLSVdBErO3oV2F5yO+5+RLgGhdkygMqKF81YW+M4V5DCF4PGTTB+pq/7xSMYWZ8cKz4z2DgMiK54tvRQqdYg3RdLtJcM16/NjGP6vvuxJjmPLxG3aN4pxUvm2Ef6WEAkae8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=RA9hwms4; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="RA9hwms4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E0F891F00893; Sun, 7 Jun 2026 10:44:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780829094; bh=J2nRWYuiiZvVORAQryv1NpG4spneeS8Wsjq5kMgRMJI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=RA9hwms4qVUQRX0m0avOc2zMqW6uaIICdmnYNmgQSwYGJVQQgDYRnl6OxMSp5q8rP eEjR1YowphbEl67Nf6ljqSaFFOb+4Pgp9YYnaU24vQDxTiKOWNxEaN2a/r+diRF36u 7h1ic+wJ5wHXxjqITB54eyX7TedsIQDSL1wL/kco= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, stable , Ian Abbott Subject: [PATCH 7.0 245/332] comedi: comedi_test: fix check for valid scan_begin_src in waveform_ai_cmdtest() Date: Sun, 7 Jun 2026 12:00:14 +0200 Message-ID: <20260607095737.040320945@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260607095728.031258202@linuxfoundation.org> References: <20260607095728.031258202@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.0-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ian Abbott commit 542f5248cb481073203e0dadab5bcbd28aeae308 upstream. Commit 783ddaebd397 ("staging: comedi: comedi_test: support scan_begin_src == TRIG_FOLLOW") neglected to add a test that `scan_begin_src` has only one bit set. The allowed values are `TRIG_FOLLOW` and `TRIG_TIMER`, but the code incorrectly also allows `TRIG_FOLLOW | TRIG_TIMER`. Add a call to `comedi_check_trigger_is_unique()` to check that only one trigger source bit is set. Fixes: 783ddaebd397 ("staging: comedi: comedi_test: support scan_begin_src == TRIG_FOLLOW") Cc: stable Signed-off-by: Ian Abbott Link: https://patch.msgid.link/20260422162138.36003-1-abbotti@mev.co.uk Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman --- drivers/comedi/drivers/comedi_test.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/comedi/drivers/comedi_test.c +++ b/drivers/comedi/drivers/comedi_test.c @@ -274,6 +274,7 @@ static int waveform_ai_cmdtest(struct co /* Step 2a : make sure trigger sources are unique */ err |= comedi_check_trigger_is_unique(cmd->convert_src); + err |= comedi_check_trigger_is_unique(cmd->scan_begin_src); err |= comedi_check_trigger_is_unique(cmd->stop_src); /* Step 2b : and mutually compatible */