Commit 6ddf2f0c authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

misc: mic: use after free printing error message

Swap the printk and kfree() to avoid a use after free bug.

Fixes: 61e9c905 ('misc: mic: Enable VOP host side functionality')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1b79dff6
...@@ -290,9 +290,9 @@ static int vop_virtio_add_device(struct vop_vdev *vdev, ...@@ -290,9 +290,9 @@ static int vop_virtio_add_device(struct vop_vdev *vdev,
ret = vop_copy_dp_entry(vdev, argp, &type, &dd); ret = vop_copy_dp_entry(vdev, argp, &type, &dd);
if (ret) { if (ret) {
kfree(vdev);
dev_err(vop_dev(vdev), "%s %d err %d\n", dev_err(vop_dev(vdev), "%s %d err %d\n",
__func__, __LINE__, ret); __func__, __LINE__, ret);
kfree(vdev);
return ret; return ret;
} }
......
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