peak_usb_adapter::dev_free() (i.e., pcan_usb_fd_free or
pcan_usb_pro_free), how about the following path?
peak_usb_probe
-> peak_usb_create_dev (goto adap_dev_free;)
-> dev->adapter->dev_free()
-> pcan_usb_fd_free or pcan_usb_pro_free (This function uses
next_siblings as condition elements)
static void pcan_usb_fd_free(struct peak_usb_device *dev)
{
/* last device: can free shared objects now */
if (!dev->prev_siblings && !dev->next_siblings) {
struct pcan_usb_fd_device *pdev =
container_of(dev, struct pcan_usb_fd_device, dev);
/* free commands buffer */
kfree(pdev->cmd_buffer_addr);
/* free usb interface object */
kfree(pdev->usb_if);
}
}
If next_siblings is not NULL, will it lead to the missing free of
cmd_buffer_addr and usb_if?
The answer is No. Forget my silly thought.