Hello Jason Gunthorpe, The patch 09177ac91921: "vfio/mtty: Convert to use vfio_register_group_dev()" from Jun 17, 2021, leads to the following static checker warning: samples/vfio-mdev/mtty.c:742 mtty_probe() warn: '&mdev_state->next' not removed from list samples/vfio-mdev/mtty.c 730 731 mutex_init(&mdev_state->ops_lock); 732 mdev_state->mdev = mdev; 733 734 mtty_create_config_space(mdev_state); 735 736 mutex_lock(&mdev_list_lock); 737 list_add(&mdev_state->next, &mdev_devices_list); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 738 mutex_unlock(&mdev_list_lock); 739 740 ret = vfio_register_group_dev(&mdev_state->vdev); 741 if (ret) { 742 kfree(mdev_state); ^^^^^^^^^^ This is still on the list so it will lead to a user after free. 743 return ret; 744 } 745 dev_set_drvdata(&mdev->dev, mdev_state); 746 return 0; regards, dan carpenter