media: s5p-mfc: fix a couple double frees in probe
Subsystems (2)
PATCH 1/1 media: s5p-mfc: fix a couple double frees in probe
The extra calls to video_device_release() are a bug, we free these after the goto.
Fixes c974c436eaf4 ('s5p-mfc: Fix race between s5p_mfc_probe() and s5p_mfc_open()')
Signed-off-by Dan Carpenter <[email protected]>
---
This code would be easier to understand if it didn't use "come from" style label names so that "goto release_dec;" would release dec etc instead of "goto register_dec;"
drivers/media/platform/s5p-mfc/s5p_mfc.c +0 -2
@@ -1266,7 +1266,6 @@ static int s5p_mfc_probe(struct platform_device *pdev) ret =video_register_device (dev->vfd_dec,VFL_TYPE_GRABBER ,0 );if (ret) {v4l2_err (&dev->v4l2_dev,"Failed to register video device\n" ); -video_device_release (dev->vfd_dec); goto err_dec_reg; } v4l2_info(&dev->v4l2_dev,
@@ -1275,7 +1274,6 @@ static int s5p_mfc_probe(struct platform_device *pdev) ret =video_register_device (dev->vfd_enc,VFL_TYPE_GRABBER ,0 );if (ret) {v4l2_err (&dev->v4l2_dev,"Failed to register video device\n" ); -video_device_release (dev->vfd_enc); goto err_enc_reg; } v4l2_info(&dev->v4l2_dev,
Hello Dan,
Quoted 6 lines · Dan Carpenter
The extra calls to
video_device_release()are a bug, we free these after the goto.Fixes c974c436eaf4 ('s5p-mfc: Fix race between s5p_mfc_probe() and s5p_mfc_open()')Signed-off-by Dan Carpenter <[email protected]>---
Thanks for the patch but Shuah already posted the same fix before:
https://lkml.org/lkml/2016/6/8/1210
Best regards,
Javier