diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2012-04-28 11:09:48 (GMT) |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-05-07 18:23:31 (GMT) |
commit | f61861fa567928614c6dd01560b320bfeb24e3e2 (patch) | |
tree | 7c2453a4d487cdb61292b4f65f9fc21003374e88 /drivers/media/radio/radio-isa.c | |
parent | ff27cda340450b4d5267a79109204e853f95cb4c (diff) | |
download | linux-fsl-qoriq-f61861fa567928614c6dd01560b320bfeb24e3e2.tar.xz |
[media] radio-isa: fix memory leak
If there is an error when creating controls the v4l2_ctrl_handler_free
function must be called.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/radio/radio-isa.c')
-rw-r--r-- | drivers/media/radio/radio-isa.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/media/radio/radio-isa.c b/drivers/media/radio/radio-isa.c index ed9039f..c7450fb 100644 --- a/drivers/media/radio/radio-isa.c +++ b/drivers/media/radio/radio-isa.c @@ -274,23 +274,21 @@ int radio_isa_common_probe(struct radio_isa_card *isa, struct device *pdev, res = ops->s_stereo(isa, isa->stereo); if (res < 0) { v4l2_err(v4l2_dev, "Could not setup card\n"); - goto err_node_reg; + goto err_hdl; } res = video_register_device(&isa->vdev, VFL_TYPE_RADIO, radio_nr); if (res < 0) { v4l2_err(v4l2_dev, "Could not register device node\n"); - goto err_node_reg; + goto err_hdl; } v4l2_info(v4l2_dev, "Initialized radio card %s on port 0x%03x\n", drv->card, isa->io); return 0; -err_node_reg: - v4l2_ctrl_handler_free(&isa->hdl); err_hdl: - v4l2_device_unregister(&isa->v4l2_dev); + v4l2_ctrl_handler_free(&isa->hdl); err_dev_reg: release_region(isa->io, region_size); kfree(isa); |