From nobody Mon Feb 9 17:23:34 2026 Received: from smtp85.ord1d.emailsrvr.com (smtp85.ord1d.emailsrvr.com [184.106.54.85]) (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 1509635B137 for ; Fri, 30 Jan 2026 17:11:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=184.106.54.85 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769793111; cv=none; b=GwiYrjaG48WC+Agebw/YjTpluAUY9mEOViLB41Nle4PRaa/AgFS53DcqlFTlF7Cl1XPcMxiGENelmZcXTmRAR9p+ZpWJWaQ1XkWGapDFImuDUkUTRubvcZlQbwQ31Fbt0c6cIfsFdm6oDg3R2zJwc2eeGRoxYbvWjFE2whcYnfE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769793111; c=relaxed/simple; bh=4FMayF8sez9NxhjDj0oLOlBlmzx4UVNe72Rk9NwXCCU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jzR0ZJbKEAEzws4bVJPfJhPY+FF7yNDO+Oy9kuQkBYKzyGFYSNeFjOvuLMgwFQKKvWv/f/CseEKzWg36MTRj7kgy0f4pvrL/4YiBhgsT0Xe66z81T45voq0mN//d7TJdmSKExjf/fwlQs+NU2jHhNRQ1PVxaTMhA25CChVNCwDk= 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=UsdHwjxC; arc=none smtp.client-ip=184.106.54.85 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="UsdHwjxC" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mev.co.uk; s=20221208-6x11dpa4; t=1769792674; bh=4FMayF8sez9NxhjDj0oLOlBlmzx4UVNe72Rk9NwXCCU=; h=From:To:Subject:Date:From; b=UsdHwjxCY/jX4Xo3QrtezApxN9rsmpC+1uxjkagauAfQ/opGxn6mUGITGCZ1a5rbQ a2tDVSrmwkpemrdiZkWs4zMNiuE07dgtTSm1crs9bdwgneWn9j3ThsAtKm8g0N1nZZ q2P4ysYI8B7rvUJjBolnyiKuir458gVBhBHKHP8c= X-Auth-ID: abbotti@mev.co.uk Received: by smtp19.relay.ord1d.emailsrvr.com (Authenticated sender: abbotti-AT-mev.co.uk) with ESMTPSA id 49734602DB; Fri, 30 Jan 2026 12:04:33 -0500 (EST) From: Ian Abbott To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , Ian Abbott , H Hartley Sweeten Subject: [PATCH 03/46] comedi: adq12b: Add sanity checks for I/O base address Date: Fri, 30 Jan 2026 16:47:28 +0000 Message-ID: <20260130170416.49994-4-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-4-1 Content-Type: text/plain; charset="utf-8" The "adq12b" driver uses an admin-supplied configuration option (`it->options[0]`) to configure the I/O port base address of the ADQ12-B board. It currently allows any base address to be configured but the hardware only supports the following base addresses (set by an on-board jumper): 0x300, 0x320, 0x340, 0x360, 0x380, 0x3A0. Add a sanity check to ensure the device is not configured at an unsupported base address. Signed-off-by: Ian Abbott --- drivers/comedi/drivers/adq12b.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/comedi/drivers/adq12b.c b/drivers/comedi/drivers/adq12= b.c index 19d765182006..f8fa5c6ecdff 100644 --- a/drivers/comedi/drivers/adq12b.c +++ b/drivers/comedi/drivers/adq12b.c @@ -179,7 +179,8 @@ static int adq12b_attach(struct comedi_device *dev, str= uct comedi_devconfig *it) struct comedi_subdevice *s; int ret; =20 - ret =3D comedi_request_region(dev, it->options[0], 0x10); + ret =3D comedi_check_request_region(dev, it->options[0], 0x10, + 0x300, 0x3af, 0x20); if (ret) return ret; =20 --=20 2.51.0