From patchwork Fri Sep 23 21:19:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 9348891 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8BD4D60B16 for ; Fri, 23 Sep 2016 21:19:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C4F42AE12 for ; Fri, 23 Sep 2016 21:19:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 707472AE17; Fri, 23 Sep 2016 21:19:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1A01D2AE14 for ; Fri, 23 Sep 2016 21:19:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1035088AbcIWVTN (ORCPT ); Fri, 23 Sep 2016 17:19:13 -0400 Received: from smtp09.smtpout.orange.fr ([80.12.242.131]:27408 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1035083AbcIWVTJ (ORCPT ); Fri, 23 Sep 2016 17:19:09 -0400 Received: from localhost.localdomain ([92.140.231.207]) by mwinf5d32 with ME id n9K51t0064V8R7g039K5Gh; Fri, 23 Sep 2016 23:19:06 +0200 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Fri, 23 Sep 2016 23:19:06 +0200 X-ME-IP: 92.140.231.207 From: Christophe JAILLET To: mchehab@kernel.org, matthias.bgg@gmail.com Cc: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] [media] VPU: mediatek: Fix return value in case of error Date: Fri, 23 Sep 2016 23:19:01 +0200 Message-Id: <1474665541-7454-1-git-send-email-christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.7.4 X-Antivirus: avast! (VPS 160923-1, 23/09/2016), Outbound message X-Antivirus-Status: Clean Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If 'dma_alloc_coherent()' returns NULL, 'vpu_alloc_ext_mem()' will return 0 which means success. Return -ENOMEM instead. Signed-off-by: Christophe JAILLET --- drivers/media/platform/mtk-vpu/mtk_vpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/mtk-vpu/mtk_vpu.c b/drivers/media/platform/mtk-vpu/mtk_vpu.c index c9bf58c97878..3edb5ed852e6 100644 --- a/drivers/media/platform/mtk-vpu/mtk_vpu.c +++ b/drivers/media/platform/mtk-vpu/mtk_vpu.c @@ -674,7 +674,7 @@ static int vpu_alloc_ext_mem(struct mtk_vpu *vpu, u32 fw_type) GFP_KERNEL); if (!vpu->extmem[fw_type].va) { dev_err(dev, "Failed to allocate the extended program memory\n"); - return PTR_ERR(vpu->extmem[fw_type].va); + return -ENOMEM; } /* Disable extend0. Enable extend1 */