Skip to contentSkip to conversation

media: aspeed: fix an incorrect return code on buffer allocation failure

PATCH In review Jae Hyun Yoo 2 participants 3 messages Aug 23, 2019 – Aug 26, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/media/platform/aspeed-video.c | 1 +
 1 file changed, 1 insertion(+)
drivers/media/platform/aspeed-video.c +1 -0
index f899ac3b4a61..94f97d96dabc 100644
@@ -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;
 	}
 
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Jae Hyun Yoo

It returns '0' even when a failure happens on jpeg buffer allocation so this commit fixes the issue.

Quoted 22 lines
---
 drivers/media/platform/aspeed-video.c | 1 +
 1 file changed, 1 insertion(+)
drivers/media/platform/aspeed-video.c +1 -0
index f899ac3b4a61..94f97d96dabc 100644
@@ -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;
 	}
Signature · 2 lines
-- 
2.7.4