Allocate the zoran structure with devm_ functions permit to simplify
code.
Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
exit_free:
v4l2_ctrl_handler_free(&zr->hdl);
v4l2_device_unregister(&zr->v4l2_dev);
- kfree(zr);
}
void zoran_vdev_release(struct video_device *vdev)
return -ENOENT;
}
- zr = kzalloc(sizeof(*zr), GFP_KERNEL);
+ zr = devm_kzalloc(&pdev->dev, sizeof(*zr), GFP_KERNEL);
if (!zr)
return -ENOMEM;
v4l2_ctrl_handler_free(&zr->hdl);
v4l2_device_unregister(&zr->v4l2_dev);
zr_free_mem:
- kfree(zr);
return -ENODEV;
}