misc: mic: use after free printing error message

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

Fixes: 61e9c905df ('misc: mic: Enable VOP host side functionality')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Dan Carpenter 2016-02-12 09:40:26 +03:00 committed by Greg Kroah-Hartman
parent 1b79dff672
commit 6ddf2f0cb1
1 changed files with 1 additions and 1 deletions

View File

@ -290,9 +290,9 @@ static int vop_virtio_add_device(struct vop_vdev *vdev,
ret = vop_copy_dp_entry(vdev, argp, &type, &dd);
if (ret) {
kfree(vdev);
dev_err(vop_dev(vdev), "%s %d err %d\n",
__func__, __LINE__, ret);
kfree(vdev);
return ret;
}