Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 816c9311 authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman
Browse files

misc: mic: double free on ioctl error path



This function only has one caller.  Freeing "vdev" here leads to a use
after free bug.  There are several other error paths in this function
but this is the only one which frees "vdev".  It looks like the kfree()
can be safely removed.

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 ddc5c9a3
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -292,7 +292,6 @@ static int vop_virtio_add_device(struct vop_vdev *vdev,
	if (ret) {
	if (ret) {
		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;
	}
	}