From: Al Viro Date: Fri, 17 Aug 2012 23:49:09 +0000 (-0400) Subject: vfio: don't dereference after kfree... X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=934ad4c235f87dcb9206abdfa22922358999afab;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git vfio: don't dereference after kfree... Acked-by: Alex Williamson Signed-off-by: Al Viro --- diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c index 9591e2b509d7..0b025d58de81 100644 --- a/drivers/vfio/vfio.c +++ b/drivers/vfio/vfio.c @@ -416,8 +416,9 @@ static void vfio_device_release(struct kref *kref) /* Device reference always implies a group reference */ static void vfio_device_put(struct vfio_device *device) { + struct vfio_group *group = device->group; kref_put(&device->kref, vfio_device_release); - vfio_group_put(device->group); + vfio_group_put(group); } static void vfio_device_get(struct vfio_device *device)