media: imx: fix a potential memory leak in imx_media_csc_scaler_device_init()
commit fc5f8aec77704373ee804b5dba0e0e5029c0f180 upstream.
Add video_device_release() in label 'err_m2m' to release the memory
allocated by video_device_alloc() and prevent potential memory leaks.
Remove the reduntant code in label 'err_m2m'.
Fixes: a8ef0488cc ("media: imx: add csc/scaler mem2mem device")
Cc: stable@vger.kernel.org
Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
a452610472
commit
b50fde177d
@@ -914,7 +914,7 @@ imx_media_csc_scaler_device_init(struct imx_media_dev *md)
|
||||
return &priv->vdev;
|
||||
|
||||
err_m2m:
|
||||
video_set_drvdata(vfd, NULL);
|
||||
video_device_release(vfd);
|
||||
err_vfd:
|
||||
kfree(priv);
|
||||
return ERR_PTR(ret);
|
||||
|
||||
Reference in New Issue
Block a user