summaryrefslogtreecommitdiff
path: root/drivers/vfio
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2022-12-08 19:02:17 +0300
committerAlex Williamson <alex.williamson@redhat.com>2022-12-12 14:10:12 -0700
commit70be6f322860d322ebcd120cf0c05402ead5c6de (patch)
tree4573159ffe9b24bbdec01578a03766bd0a5b98b7 /drivers/vfio
parentfe3dd71db2b81c202bc80532bbe0e07238a45ed9 (diff)
downloadlwn-70be6f322860d322ebcd120cf0c05402ead5c6de.tar.gz
lwn-70be6f322860d322ebcd120cf0c05402ead5c6de.zip
vfio/mlx5: error pointer dereference in error handling
This code frees the wrong "buf" variable and results in an error pointer dereference. Fixes: 34e2f27143d1 ("vfio/mlx5: Introduce multiple loads") Signed-off-by: Dan Carpenter <error27@gmail.com> Reviewed-by: Yishai Hadas <yishaih@nvidia.com> Link: https://lore.kernel.org/r/Y5IKia5SaiVxYmG5@kili Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'drivers/vfio')
-rw-r--r--drivers/vfio/pci/mlx5/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/vfio/pci/mlx5/main.c b/drivers/vfio/pci/mlx5/main.c
index 94f7a0fd10e8..031ac8cc215d 100644
--- a/drivers/vfio/pci/mlx5/main.c
+++ b/drivers/vfio/pci/mlx5/main.c
@@ -826,7 +826,7 @@ mlx5vf_pci_resume_device_data(struct mlx5vf_pci_core_device *mvdev)
spin_lock_init(&migf->list_lock);
return migf;
out_buf:
- mlx5vf_free_data_buffer(buf);
+ mlx5vf_free_data_buffer(migf->buf);
out_pd:
mlx5vf_cmd_dealloc_pd(migf);
out_free: