mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-05 18:39:59 +00:00
[media] vp7045: fix buffer setup
dvb_usb_device_init calls the frontend_attach method of this driver which uses vp7045_usb_ob. In order to have a buffer ready in vp7045_usb_op, it has to be allocated before that happens. Luckily we can use the whole private data as the buffer as it gets separately allocated on the heap via kzalloc in dvb_usb_device_init and is thus apt for use via usb_control_msg. This fixes a BUG: unable to handle kernel paging request at 0000000000001e78 reported by Tino Keitel and diagnosed by Dan Carpenter. Cc: stable@kernel.org # For v3.0 and upper Tested-by: Tino Keitel <tino.keitel@tikei.de> Signed-off-by: Florian Mickler <florian@mickler.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
de4ed0c111
commit
fc61ccd35f
1 changed files with 4 additions and 22 deletions
|
@ -224,26 +224,8 @@ static struct dvb_usb_device_properties vp7045_properties;
|
||||||
static int vp7045_usb_probe(struct usb_interface *intf,
|
static int vp7045_usb_probe(struct usb_interface *intf,
|
||||||
const struct usb_device_id *id)
|
const struct usb_device_id *id)
|
||||||
{
|
{
|
||||||
struct dvb_usb_device *d;
|
return dvb_usb_device_init(intf, &vp7045_properties,
|
||||||
int ret = dvb_usb_device_init(intf, &vp7045_properties,
|
THIS_MODULE, NULL, adapter_nr);
|
||||||
THIS_MODULE, &d, adapter_nr);
|
|
||||||
if (ret)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
d->priv = kmalloc(20, GFP_KERNEL);
|
|
||||||
if (!d->priv) {
|
|
||||||
dvb_usb_device_exit(intf);
|
|
||||||
return -ENOMEM;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void vp7045_usb_disconnect(struct usb_interface *intf)
|
|
||||||
{
|
|
||||||
struct dvb_usb_device *d = usb_get_intfdata(intf);
|
|
||||||
kfree(d->priv);
|
|
||||||
dvb_usb_device_exit(intf);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct usb_device_id vp7045_usb_table [] = {
|
static struct usb_device_id vp7045_usb_table [] = {
|
||||||
|
@ -258,7 +240,7 @@ MODULE_DEVICE_TABLE(usb, vp7045_usb_table);
|
||||||
static struct dvb_usb_device_properties vp7045_properties = {
|
static struct dvb_usb_device_properties vp7045_properties = {
|
||||||
.usb_ctrl = CYPRESS_FX2,
|
.usb_ctrl = CYPRESS_FX2,
|
||||||
.firmware = "dvb-usb-vp7045-01.fw",
|
.firmware = "dvb-usb-vp7045-01.fw",
|
||||||
.size_of_priv = sizeof(u8 *),
|
.size_of_priv = 20,
|
||||||
|
|
||||||
.num_adapters = 1,
|
.num_adapters = 1,
|
||||||
.adapter = {
|
.adapter = {
|
||||||
|
@ -305,7 +287,7 @@ static struct dvb_usb_device_properties vp7045_properties = {
|
||||||
static struct usb_driver vp7045_usb_driver = {
|
static struct usb_driver vp7045_usb_driver = {
|
||||||
.name = "dvb_usb_vp7045",
|
.name = "dvb_usb_vp7045",
|
||||||
.probe = vp7045_usb_probe,
|
.probe = vp7045_usb_probe,
|
||||||
.disconnect = vp7045_usb_disconnect,
|
.disconnect = dvb_usb_device_exit,
|
||||||
.id_table = vp7045_usb_table,
|
.id_table = vp7045_usb_table,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue