From nobody Mon Feb 9 19:25:58 2026 Received: from smtp83.ord1d.emailsrvr.com (smtp83.ord1d.emailsrvr.com [184.106.54.83]) (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 74304381700 for ; Fri, 30 Jan 2026 17:05:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=184.106.54.83 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769792715; cv=none; b=Y7bGI1kqTZBPDchxONkxx9HRI9areAuQvOA4ly5gPDao9XPrDQ8dhay800I39qh0z047M+okT8T1qj0xCX8FevqaAY7sel4/AWSlLMJxtaalC21+Wa9TvnJCnAy1WV6Ofm9BfgiLzNS/SZ/DzED5TihjN3ulagE4hNserayxfok= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769792715; c=relaxed/simple; bh=BHtRYKvym9dsjgXQXfGX6rAx8v4hl85H3VwBS1f6qgg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KvTkw3FAgQRKHIbKRgR/CXu4Xjkqoo3uv8dbaewN5nlEbWwllEh26SOYcaMLnjMcdm8FoU+kiMVbtJiD4eaZFEDOxWddWfgF3Tj+gP7a/4tPLGmzt72qJkYRYFYSd9hX88fduLA6M08cTKJkmawoKcm47Dh/DfPn7avJ61nTrKQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mev.co.uk; spf=pass smtp.mailfrom=mev.co.uk; dkim=pass (1024-bit key) header.d=mev.co.uk header.i=@mev.co.uk header.b=TAVQJuxi; arc=none smtp.client-ip=184.106.54.83 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mev.co.uk Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mev.co.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mev.co.uk header.i=@mev.co.uk header.b="TAVQJuxi" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mev.co.uk; s=20221208-6x11dpa4; t=1769792713; bh=BHtRYKvym9dsjgXQXfGX6rAx8v4hl85H3VwBS1f6qgg=; h=From:To:Subject:Date:From; b=TAVQJuxiAux19mW8kczxW8sxwW6p7i6VgCbcgbBqfNh6PnuVtqOM7xL//6Lmf+4CP 8/HTkT5CujWXESjODYQ7nkm1u5hcb7IOW4SL5hAlWBUMdmmsxTYallNBPchbZHkPiJ nf+dJAa8GOC6SB7QQfGJbYPildjEwahT4x8zpaFU= X-Auth-ID: abbotti@mev.co.uk Received: by smtp19.relay.ord1d.emailsrvr.com (Authenticated sender: abbotti-AT-mev.co.uk) with ESMTPSA id F1FE5601DE; Fri, 30 Jan 2026 12:05:12 -0500 (EST) From: Ian Abbott To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , Ian Abbott , H Hartley Sweeten Subject: [PATCH 39/46] comedi: pcm3724: Add sanity checks for I/O base address Date: Fri, 30 Jan 2026 16:48:04 +0000 Message-ID: <20260130170416.49994-40-abbotti@mev.co.uk> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260130170416.49994-1-abbotti@mev.co.uk> References: <20260130170416.49994-1-abbotti@mev.co.uk> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Classification-ID: 429d5722-7f90-4557-8586-08913fa85e9e-40-1 Content-Type: text/plain; charset="utf-8" The "pcm3724" driver uses an admin-supplied configuration option (`it->options[0]`) to configure the I/O port base address of a PCM-3724 board. It currently allows any base address to be configured but the hardware only supports base addresses (configured by on-board DIP switches) in the range 0 to 0x3F0 on 16-byte boundaries. Add a sanity check to ensure the device is not configured at an unsupported base address. Signed-off-by: Ian Abbott --- drivers/comedi/drivers/pcm3724.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/comedi/drivers/pcm3724.c b/drivers/comedi/drivers/pcm3= 724.c index fb41de3baef8..867bb5b3860a 100644 --- a/drivers/comedi/drivers/pcm3724.c +++ b/drivers/comedi/drivers/pcm3724.c @@ -194,7 +194,8 @@ static int pcm3724_attach(struct comedi_device *dev, if (!priv) return -ENOMEM; =20 - ret =3D comedi_request_region(dev, it->options[0], 0x10); + ret =3D comedi_check_request_region(dev, it->options[0], 0x10, + 0, 0x3ff, 16); if (ret) return ret; =20 --=20 2.51.0