mirror of
https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux-stable.git
synced 2025-09-13 11:07:46 +10:00
pcmcia: Fix a NULL pointer dereference in __iodyn_find_io_region()
commit44822df89e
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:49b1153adf
("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>
This commit is contained in:
parent
ec1b3e6d52
commit
b990c8c6ff
@ -62,6 +62,9 @@ static struct resource *__iodyn_find_io_region(struct pcmcia_socket *s,
|
||||
unsigned long min = base;
|
||||
int ret;
|
||||
|
||||
if (!res)
|
||||
return NULL;
|
||||
|
||||
data.mask = align - 1;
|
||||
data.offset = base & data.mask;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user