From patchwork Mon Jul 17 20:09:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13318392 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 271CAEB64DA for ; Wed, 19 Jul 2023 06:55:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=qZkcDekT5b92WU53zpLAbUsNqsHpoGKoWZrnp731SOo=; b=vz2gydxtNZlbeb j7axVH0HPrc/N76ndaiNwFRno8vrnGe1unrWusVyIMH/W1Zpa0e2lW6GHhx41O0BYrFL3y5Jm73me 5oXhNHH2IVI5oiC0o0HFCfsoLkEdb+i4hf9ljVY59tYj8BILCCz6TlvcwwkXEkjp/W/G8GDqCaQPR 8L2915ZhEiTAe4N/mCUW8sXSGzAFvnF+xBOsMh9XIS8rGN5aGyV52v+H03HUwn+FEZiVZKiswatDz 4aHV0gTjJKMeWyuXkGcHLHBZ/DITJdjShBMGUSgZCkXP3gzc9Ys6tQ2xczxpZneR/XnyS2lzLgi9s +7w04vciDNuYrgW4P8Uw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qM15A-005xlr-01; Wed, 19 Jul 2023 06:54:44 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qM153-005xhB-1m for linux-arm-kernel@bombadil.infradead.org; Wed, 19 Jul 2023 06:54:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:In-Reply-To:References; bh=UEj0AXAxlyKrDR2T9dRAsXWpemXdwncxY2h++Qk+qQw=; b=RtEkF/oPmknbPZeDnC7B9l05Et +1YXjFznDcVfZcq9GKMZ6Hn3JGPu01uk9oa1kgUj0GlAdMBLbTaduA7JWNXl4/cmoyiO7S0hR4mWH KgXfx0m6MsU2I0VTAczHEE9HZJ2m83JutjbnUY1rRo/+mzYuDlpL5sYUpXjDFwBxqaD8eneIVmv2X hxXAsmq3aXpNF/OZCH5EGzvF3Rm5NIqW5sXelLWptlI2lrbddOGlr7NKlUhcQG6qhTYObiEe6V/NZ D6IR7yqzJBqthI9hoC4bDMuEC/5wPwN6rLUS5FeNZqMigGEY+eZZEpBIqLlZvRf0J6FN3sMvNJGBc 7E7gVcPQ==; Received: from smtp-29.smtpout.orange.fr ([80.12.242.29] helo=smtp.smtpout.orange.fr) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qLUee-009Jj4-06 for linux-arm-kernel@lists.infradead.org; Mon, 17 Jul 2023 20:17:14 +0000 Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id LUX2q5vfabkI3LUX3qnKyX; Mon, 17 Jul 2023 22:09:26 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1689624566; bh=UEj0AXAxlyKrDR2T9dRAsXWpemXdwncxY2h++Qk+qQw=; h=From:To:Cc:Subject:Date; b=d5cNBpyckTzPUqzqnhq0Y8pnMXCGVib/3GQbOzMQQsYxZ3ZYKt+G4E2/m0JKWFX+e qqDGQBU3SKWwxg6+fc7iAiwf/ujP3ncKaZh5EqZ0NlrQbWfy0k6ZMAHR2alnc/RV0O BRWLayHoFfKe22+BCe+9ZH74Rp3Yb4VGTr//1QNai0xaOnpWocQub4BxIKf/4/XYQQ aC6q05JzSPNLdSdhUaYi7DjgHHxT1Idu1MjlUL6CW1hWdXd95uygiX+S50KeqRHdcM t5KbEAcOD6WglubNCuVqoWfi+MZ7NLw0gvaibiq0kYwspynZkdd5yCqTNi6bIdnZRC sbthVNZOAmuLA== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 17 Jul 2023 22:09:26 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: Tiffany Lin , Andrew-CT Chen , Yunfei Dong , Mauro Carvalho Chehab , Matthias Brugger , AngeloGioacchino Del Regno , Xiaoyong Lu , Nicolas Dufresne , Hans Verkuil Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH] media: mediatek: vcodec: Fix an error handling path in vdec_msg_queue_init() Date: Mon, 17 Jul 2023 22:09:19 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230717_211712_358423_103CCDB6 X-CRM114-Status: UNSURE ( 9.32 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org All errors go to the error handling path, except this one. Be consistent and also branch to it. Fixes: 2f5d0aef37c6 ("media: mediatek: vcodec: support stateless AV1 decoder") Signed-off-by: Christophe JAILLET --- drivers/media/platform/mediatek/vcodec/vdec_msg_queue.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/mediatek/vcodec/vdec_msg_queue.c b/drivers/media/platform/mediatek/vcodec/vdec_msg_queue.c index 04e6dc6cfa1d..c6cc2785e0e8 100644 --- a/drivers/media/platform/mediatek/vcodec/vdec_msg_queue.c +++ b/drivers/media/platform/mediatek/vcodec/vdec_msg_queue.c @@ -338,14 +338,16 @@ int vdec_msg_queue_init(struct vdec_msg_queue *msg_queue, err = mtk_vcodec_mem_alloc(ctx, &lat_buf->rd_mv_addr); if (err) { mtk_v4l2_err("failed to allocate rd_mv_addr buf[%d]", i); - return -ENOMEM; + err = -ENOMEM; + goto mem_alloc_err; } lat_buf->tile_addr.size = VDEC_LAT_TILE_SZ; err = mtk_vcodec_mem_alloc(ctx, &lat_buf->tile_addr); if (err) { mtk_v4l2_err("failed to allocate tile_addr buf[%d]", i); - return -ENOMEM; + err = -ENOMEM; + goto mem_alloc_err; } }