From: Jae Hyun Yoo Date: Fri, 23 Aug 2019 21:29:57 +0000 (-0300) Subject: media: aspeed: fix an incorrect return code on buffer allocation failure X-Git-Tag: v5.4-rc1~145^2~20 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=578c5ab074981b1e74331e58df4b8ef4439df563;p=linux.git media: aspeed: fix an incorrect return code on buffer allocation failure It returns '0' even when a failure happens on jpeg buffer allocation so this commit fixes the issue. Signed-off-by: Jae Hyun Yoo Reviewed-by: Andrew Jeffery Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/platform/aspeed-video.c b/drivers/media/platform/aspeed-video.c index f899ac3b4a61..94f97d96dabc 100644 --- a/drivers/media/platform/aspeed-video.c +++ b/drivers/media/platform/aspeed-video.c @@ -1624,6 +1624,7 @@ static int aspeed_video_init(struct aspeed_video *video) if (!aspeed_video_alloc_buf(video, &video->jpeg, VE_JPEG_HEADER_SIZE)) { dev_err(dev, "Failed to allocate DMA for JPEG header\n"); + rc = -ENOMEM; goto err_release_reserved_mem; }