Re: [PATCH 1/5] uio: Add hv_vmbus_client driver

From: kernel test robot
Date: Sat Jun 03 2023 - 22:06:19 EST


Hi Saurabh,

kernel test robot noticed the following build warnings:

[auto build test WARNING on char-misc/char-misc-testing]
[also build test WARNING on char-misc/char-misc-next char-misc/char-misc-linus linus/master v6.4-rc4 next-20230602]
[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/Saurabh-Sengar/uio-Add-hv_vmbus_client-driver/20230602-160029
base: char-misc/char-misc-testing
patch link: https://lore.kernel.org/r/1685692629-31351-2-git-send-email-ssengar%40linux.microsoft.com
patch subject: [PATCH 1/5] uio: Add hv_vmbus_client driver
config: i386-randconfig-c001-20230604 (https://download.01.org/0day-ci/archive/20230604/202306040910.13oLufQd-lkp@xxxxxxxxx/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202306040910.13oLufQd-lkp@xxxxxxxxx/

cocci warnings: (new ones prefixed by >>)
>> drivers/uio/uio_hv_vmbus_client.c:195:1-6: WARNING: invalid free of devm_ allocated data

vim +195 drivers/uio/uio_hv_vmbus_client.c

158
159 static int uio_hv_vmbus_probe(struct hv_device *dev, const struct hv_vmbus_device_id *dev_id)
160 {
161 struct uio_hv_vmbus_dev *pdata;
162 int ret = 0;
163 char *name = NULL;
164
165 pdata = devm_kzalloc(&dev->device, sizeof(*pdata), GFP_KERNEL);
166 if (!pdata)
167 return -ENOMEM;
168
169 name = kasprintf(GFP_KERNEL, "%pUl", &dev->dev_instance);
170
171 /* Fill general uio info */
172 pdata->info.name = name; /* /sys/class/uio/uioX/name */
173 pdata->info.version = DRIVER_VERSION;
174 pdata->info.irqcontrol = uio_hv_vmbus_irqcontrol;
175 pdata->info.open = uio_hv_vmbus_open;
176 pdata->info.release = uio_hv_vmbus_release;
177 pdata->info.irq = UIO_IRQ_CUSTOM;
178 pdata->info.priv = pdata;
179 pdata->device = dev;
180
181 ret = uio_register_device(&dev->device, &pdata->info);
182 if (ret) {
183 dev_err(&dev->device, "uio_hv_vmbus register failed\n");
184 goto fail;
185 }
186
187 ret = sysfs_create_file(&dev->device.kobj, &dev_attr_ring_size.attr);
188 if (ret)
189 dev_notice(&dev->device, "sysfs create ring size file failed; %d\n", ret);
190
191 hv_set_drvdata(dev, pdata);
192 return 0;
193
194 fail:
> 195 kfree(pdata);
196 return ret;
197 }
198

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