Re: [PATCH] gpib: tnt4882: fix memory leak on probe failure

From: kernel test robot

Date: Sun Sep 13 2026 - 17:31:46 EST


Hi Guangshuo,

kernel test robot noticed the following build errors:

[auto build test ERROR on kees/for-next/kspp]
[also build test ERROR on linus/master kees/for-next/pstore v7.3-rc2 next-20260911]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Guangshuo-Li/gpib-tnt4882-fix-memory-leak-on-probe-failure/20260913-143603
base: https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/kspp
patch link: https://lore.kernel.org/r/20260913063603.1443403-1-lgs201920130244%40gmail.com
patch subject: [PATCH] gpib: tnt4882: fix memory leak on probe failure
config: mips-randconfig-r132-20260914 (https://download.01.org/0day-ci/archive/20260914/202609140501.8A2YYS6n-lkp@xxxxxxxxx/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 148ee2b266b73a49f1f31d0bd17d4818b91bee9f)
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260914/202609140501.8A2YYS6n-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202609140501.8A2YYS6n-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

>> drivers/gpib/tnt4882/tnt4882_gpib.c:1588:2: error: use of undeclared identifier 'ret'
1588 | ret = ni_gpib_config(link);
| ^~~
drivers/gpib/tnt4882/tnt4882_gpib.c:1589:6: error: use of undeclared identifier 'ret'
1589 | if (ret) {
| ^~~
drivers/gpib/tnt4882/tnt4882_gpib.c:1594:9: error: use of undeclared identifier 'ret'
1594 | return ret;
| ^~~
3 errors generated.


vim +/ret +1588 drivers/gpib/tnt4882/tnt4882_gpib.c

1557
1558 /*
1559 * ni_gpib_probe() creates an "instance" of the driver, allocating
1560 * local data structures for one device. The device is registered
1561 * with Card Services.
1562 */
1563
1564 static int ni_gpib_probe(struct pcmcia_device *link)
1565 {
1566 struct local_info_t *info;
1567 //struct struct gpib_board *dev;
1568
1569 /* Allocate space for private device-specific data */
1570 info = kzalloc_obj(*info);
1571 if (!info)
1572 return -ENOMEM;
1573
1574 info->p_dev = link;
1575 link->priv = info;
1576
1577 /*
1578 * General socket configuration defaults can go here. In this
1579 * client, we assume very little, and rely on the CIS for almost
1580 * everything. In most clients, many details (i.e., number, sizes,
1581 * and attributes of IO windows) are fixed by the nature of the
1582 * device, and can be hard-wired here.
1583 */
1584 link->config_flags = CONF_ENABLE_IRQ | CONF_AUTO_SET_IO;
1585
1586 /* Register with Card Services */
1587 curr_dev = link;
> 1588 ret = ni_gpib_config(link);
1589 if (ret) {
1590 kfree(info);
1591 link->priv = NULL;
1592 }
1593
1594 return ret;
1595 }
1596

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki