Skip to content
Commit 0af5160e authored by Colin Ian King's avatar Colin Ian King Committed by Alex Williamson
Browse files

vfio/mdpy: Fix memory leak of object mdev_state->vconfig

In the case where the call to vfio_register_group_dev fails the error
return path kfree's mdev_state but not mdev_state->vconfig. Fix this
by kfree'ing mdev_state->vconfig before returning.

Addresses-Coverity: ("Resource leak")
Fixes: 437e4136

 ("vfio/mdpy: Convert to use vfio_register_group_dev()")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210622183710.28954-1-colin.king@canonical.com
Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
parent c7396f2e
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment