提交 fcf94c89 编写于 作者: F Florin Malita 提交者: Mauro Carvalho Chehab

V4L/DVB (6325): Double-free in cx23885_initdev

Both cx23885_initdev and cx23885_dev_setup free the device in their
error path so a failure in the latter causes a double-free. Since
cx23885_dev_setup is only called from cx23885_initdev, it should be safe
to remove its deallocation and leave the cleanup up to the allocating
function.

Coverity CID 1922.
Signed-off-by: NFlorin Malita <fmalita@gmail.com>
CC: Steven Toth <stoth@hauppauge.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@infradead.org>
上级 a13625c5
......@@ -793,7 +793,7 @@ static int cx23885_dev_setup(struct cx23885_dev *dev)
dev->pci->subsystem_device);
cx23885_devcount--;
goto fail_free;
return -ENODEV;
}
/* PCIe stuff */
......@@ -835,10 +835,6 @@ static int cx23885_dev_setup(struct cx23885_dev *dev)
}
return 0;
fail_free:
kfree(dev);
return -ENODEV;
}
void cx23885_dev_unregister(struct cx23885_dev *dev)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册