From patchwork Wed Jan 5 18:07:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar Mahadev Lad X-Patchwork-Id: 530295 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 B082AC433F5 for ; Wed, 5 Jan 2022 18:07:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242742AbiAESHY (ORCPT ); Wed, 5 Jan 2022 13:07:24 -0500 Received: from relmlor1.renesas.com ([210.160.252.171]:43468 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S242741AbiAESHU (ORCPT ); Wed, 5 Jan 2022 13:07:20 -0500 X-IronPort-AV: E=Sophos;i="5.88,264,1635174000"; d="scan'208";a="105608771" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 06 Jan 2022 03:07:19 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 33BDC40BD264; Thu, 6 Jan 2022 03:07:17 +0900 (JST) From: Lad Prabhakar To: Al Cooper , Greg Kroah-Hartman , Jiri Slaby Cc: Andy Shevchenko , Florian Fainelli , Prabhakar , Lad Prabhakar , linux-serial@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-kernel@vger.kernel.org Subject: [PATCH v2] serial: 8250_bcm7271: Fix return error code in case of dma_alloc_coherent() failure Date: Wed, 5 Jan 2022 18:07:03 +0000 Message-Id: <20220105180704.8989-1-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org In case of dma_alloc_coherent() failure return -ENOMEM instead of returning -EINVAL. Reported-by: Andy Shevchenko Signed-off-by: Lad Prabhakar Acked-by: Florian Fainelli Reviewed-by: Andy Shevchenko --- v1->v2 * Dropped fixes tag as suggested by Florian/Andy --- 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; } }