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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8EFE1C433EF for ; Tue, 4 Jan 2022 17:50:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235939AbiADRuu (ORCPT ); Tue, 4 Jan 2022 12:50:50 -0500 Received: from relmlor1.renesas.com ([210.160.252.171]:30825 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233839AbiADRuq (ORCPT ); Tue, 4 Jan 2022 12:50:46 -0500 X-IronPort-AV: E=Sophos;i="5.88,261,1635174000"; d="scan'208";a="105493655" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 05 Jan 2022 02:50:44 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id A87A240B3513; Wed, 5 Jan 2022 02:50:42 +0900 (JST) From: Lad Prabhakar To: Al Cooper , Greg Kroah-Hartman , Jiri Slaby , Florian Fainelli , Lad Prabhakar Cc: Andy Shevchenko , Prabhakar , linux-serial@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-kernel@vger.kernel.org Subject: [PATCH] serial: 8250_bcm7271: Fix return error code in case of dma_alloc_coherent() failure Date: Tue, 4 Jan 2022 17:50:08 +0000 Message-Id: <20220104175009.7029-1-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In case of dma_alloc_coherent() failure return -ENOMEM instead of returning -EINVAL. Fixes: c195438f1e84 ("serial: 8250_bcm7271: Propagate error codes from brcmuart_probe()") Reported-by: Andy Shevchenko Signed-off-by: Lad Prabhakar --- Hi All, This patch applies to -next. Cheers, Prabhakar --- drivers/tty/serial/8250/8250_bcm7271.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/8250/8250_bcm7271.c b/drivers/tty/serial/8250/8250_bcm7271.c index cc60a7874e8b..9b878d023dac 100644 --- a/drivers/tty/serial/8250/8250_bcm7271.c +++ b/drivers/tty/serial/8250/8250_bcm7271.c @@ -1075,7 +1075,7 @@ static int brcmuart_probe(struct platform_device *pdev) priv->rx_size, &priv->rx_addr, GFP_KERNEL); if (!priv->rx_bufs) { - ret = -EINVAL; + ret = -ENOMEM; goto err; } priv->tx_size = UART_XMIT_SIZE; @@ -1083,7 +1083,7 @@ static int brcmuart_probe(struct platform_device *pdev) priv->tx_size, &priv->tx_addr, GFP_KERNEL); if (!priv->tx_buf) { - ret = -EINVAL; + ret = -ENOMEM; goto err; } } -- 2.17.1