]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
pcmcia: Fix a NULL pointer dereference in __iodyn_find_io_region()
authorMa Ke <make24@iscas.ac.cn>
Tue, 12 Aug 2025 07:25:09 +0000 (15:25 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 9 Sep 2025 16:58:15 +0000 (18:58 +0200)
commitfafa7450075f41d232bc785a4ebcbf16374f2076
tree9f2107fcd0b9f6d89bcdef9498610a7fd31b3a40
parent650c14abe3031dd222e8c4d042cf49317ff26770
pcmcia: Fix a NULL pointer dereference in __iodyn_find_io_region()

commit 44822df89e8f3386871d9cad563ece8e2fd8f0e7 upstream.

In __iodyn_find_io_region(), pcmcia_make_resource() is assigned to
res and used in pci_bus_alloc_resource(). There is a dereference of res
in pci_bus_alloc_resource(), which could lead to a NULL pointer
dereference on failure of pcmcia_make_resource().

Fix this bug by adding a check of res.

Cc: stable@vger.kernel.org
Fixes: 49b1153adfe1 ("pcmcia: move all pcmcia_resource_ops providers into one module")
Signed-off-by: Ma Ke <make24@iscas.ac.cn>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pcmcia/rsrc_iodyn.c