* [bug report] vfio/mtty: Convert to use vfio_register_group_dev()
@ 2021-06-25 8:20 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2021-06-25 8:20 UTC (permalink / raw)
To: jgg; +Cc: kvm
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-06-25 8:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-25 8:20 [bug report] vfio/mtty: Convert to use vfio_register_group_dev() Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).