Skip to content

Commit

Permalink
media: aspeed: fix error return code in aspeed_video_setup_video()
Browse files Browse the repository at this point in the history
[ Upstream commit d497fcd ]

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: d2b4387 ("media: platform: Add Aspeed Video Engine driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Zhang Changzhong authored and gregkh committed Mar 4, 2021
1 parent 438d2cc commit c7ebd8b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/media/platform/aspeed-video.c
Expand Up @@ -1529,12 +1529,12 @@ static int aspeed_video_setup_video(struct aspeed_video *video)
V4L2_JPEG_CHROMA_SUBSAMPLING_420, mask,
V4L2_JPEG_CHROMA_SUBSAMPLING_444);

if (video->ctrl_handler.error) {
rc = video->ctrl_handler.error;
if (rc) {
v4l2_ctrl_handler_free(&video->ctrl_handler);
v4l2_device_unregister(v4l2_dev);

dev_err(video->dev, "Failed to init controls: %d\n",
video->ctrl_handler.error);
dev_err(video->dev, "Failed to init controls: %d\n", rc);
return rc;
}

Expand Down

0 comments on commit c7ebd8b

Please sign in to comment.