Commit 44510939 authored by Dan Carpenter's avatar Dan Carpenter Committed by Gerd Hoffmann

drm/virtio: Fix a double free in virtio_gpu_cmd_map()

This is freed both here and in the caller (virtio_gpu_vram_map()) so
it's a double free.  The correct place is only in the caller.

Fixes: 16845c5d ("drm/virtio: implement blob resources: implement vram object")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarGurchetan Singh <gurchetansingh@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/20201030114808.GD3251003@mwandaSigned-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
parent 2f62f499
......@@ -1211,10 +1211,8 @@ int virtio_gpu_cmd_map(struct virtio_gpu_device *vgdev,
struct virtio_gpu_resp_map_info *resp_buf;
resp_buf = kzalloc(sizeof(*resp_buf), GFP_KERNEL);
if (!resp_buf) {
virtio_gpu_array_put_free(objs);
if (!resp_buf)
return -ENOMEM;
}
cmd_p = virtio_gpu_alloc_cmd_resp
(vgdev, virtio_gpu_cmd_resource_map_cb, &vbuf, sizeof(*cmd_p),
......
Markdown is supported
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