Commit 2e4c5562 authored by Kyle McMartin's avatar Kyle McMartin Committed by Mauro Carvalho Chehab

[media] rc/ene_ir: fix oops on module load

dev->rdev is accessed in ene_setup_hw_settings, so it needs to be wired
up before then.

[Jarod Wilson]: Also fix a possible improper resource freeing bug while
we're looking at possible probe issues here.
Signed-off-by: default avatarKyle McMartin <kmcmartin@redhat.com>
CC: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: default avatarJarod Wilson <jarod@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 7d2edfc2
...@@ -1004,6 +1004,10 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id) ...@@ -1004,6 +1004,10 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id)
/* validate resources */ /* validate resources */
error = -ENODEV; error = -ENODEV;
/* init these to -1, as 0 is valid for both */
dev->hw_io = -1;
dev->irq = -1;
if (!pnp_port_valid(pnp_dev, 0) || if (!pnp_port_valid(pnp_dev, 0) ||
pnp_port_len(pnp_dev, 0) < ENE_IO_SIZE) pnp_port_len(pnp_dev, 0) < ENE_IO_SIZE)
goto error; goto error;
...@@ -1072,6 +1076,8 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id) ...@@ -1072,6 +1076,8 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id)
rdev->input_name = "ENE eHome Infrared Remote Transceiver"; rdev->input_name = "ENE eHome Infrared Remote Transceiver";
} }
dev->rdev = rdev;
ene_rx_setup_hw_buffer(dev); ene_rx_setup_hw_buffer(dev);
ene_setup_default_settings(dev); ene_setup_default_settings(dev);
ene_setup_hw_settings(dev); ene_setup_hw_settings(dev);
...@@ -1083,7 +1089,6 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id) ...@@ -1083,7 +1089,6 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id)
if (error < 0) if (error < 0)
goto error; goto error;
dev->rdev = rdev;
ene_notice("driver has been succesfully loaded"); ene_notice("driver has been succesfully loaded");
return 0; return 0;
error: error:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment