Skip to contentSkip to conversation

misc: mic: double free on ioctl error path

PATCH New Dan Carpenter 1 participant 1 message Jan 9, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 61e9c905df78 ("misc: mic: Enable VOP host side functionality")
drivers/misc/mic/vop/vop_vringh.c +0 -1
index 88e45234d527..fed992e2c258 100644
@@ -292,7 +292,6 @@ static int vop_virtio_add_device(struct vop_vdev *vdev,
 	if (ret) {
 		dev_err(vop_dev(vdev), "%s %d err %d\n",
 			__func__, __LINE__, ret);
-		kfree(vdev);
 		return ret;
 	}