]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
staging: gpib: Fix cb7210 pcmcia Oops
authorDave Penkler <dpenkler@gmail.com>
Thu, 13 Feb 2025 10:31:12 +0000 (11:31 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Feb 2025 15:47:17 +0000 (16:47 +0100)
The  pcmcia_driver struct was still only using the old .name
initialization in the drv field. This led to a NULL pointer
deref Oops in strcmp called from pcmcia_register_driver.

Initialize the pcmcia_driver struct name field.

Reported-by: kernel test robot <oliver.sang@intel.com>
Closes: https://lore.kernel.org/oe-lkp/202502131453.cb6d2e4a-lkp@intel.com
Fixes: e9dc69956d4d ("staging: gpib: Add Computer Boards GPIB driver")
Signed-off-by: Dave Penkler <dpenkler@gmail.com>
Link: https://lore.kernel.org/r/20250213103112.4415-1-dpenkler@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/gpib/cb7210/cb7210.c

index 381c508f62eb1d16b740cd1ca2cb18c0d13e119d..0d601b6a00fbf648ba5f3ee90d75acb3d90724bb 100644 (file)
@@ -1347,8 +1347,8 @@ static struct pcmcia_device_id cb_pcmcia_ids[] = {
 MODULE_DEVICE_TABLE(pcmcia, cb_pcmcia_ids);
 
 static struct pcmcia_driver cb_gpib_cs_driver = {
+       .name           = "cb_gpib_cs",
        .owner          = THIS_MODULE,
-       .drv = { .name = "cb_gpib_cs", },
        .id_table       = cb_pcmcia_ids,
        .probe          = cb_gpib_probe,
        .remove         = cb_gpib_remove,