Skip to content

Commit

Permalink
vfio/mlx5: error pointer dereference in error handling
Browse files Browse the repository at this point in the history
This code frees the wrong "buf" variable and results in an error pointer
dereference.

Fixes: 34e2f27 ("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>
  • Loading branch information
Dan Carpenter authored and Alex Williamson committed Dec 12, 2022
1 parent fe3dd71 commit 70be6f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/vfio/pci/mlx5/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 70be6f3

Please sign in to comment.