From nobody Fri Dec 19 20:55:29 2025 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 1C9E7C25B08 for ; Sat, 20 Aug 2022 13:01:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347262AbiHTNBK (ORCPT ); Sat, 20 Aug 2022 09:01:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347616AbiHTNA1 (ORCPT ); Sat, 20 Aug 2022 09:00:27 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25564868AD; Sat, 20 Aug 2022 05:59:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1661000351; x=1692536351; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+YvybVBwNlRymwG1fxaRQyE2wDdutvaCQCMO9iy144c=; b=Bvh+4UL/vpmEBbNkGnEFtRh0fnNVTgnkgCyeUX1A0YqQlzp8mlb3djnN 8eUP1FMD+YOU9Puc4YudomUlrK66zB2ZYCIi1wPmuXuWD1GmTj4ASFIhd ZHKq7Qo07yCF1H+pK2BRXAW8ba74uHBG1h5ITnR53qmkEpv4yeUqDzAPY ER53RWtcnWGtZN0Nyo4nkSH77ntoVgCkf9ARFoEhgQR17ePJfNm/dyqFP r7syThVUQKxnsPiIxILBZTj/XXmOWhukMlO4mWHeR+h+h9QTrfl/MCtEa ay4A3SIDTyQTBaxTs6q6cCWYuAq6UWgXSaCrVtyCKAUV26GNnltN7OKYH A==; X-IronPort-AV: E=Sophos;i="5.93,251,1654585200"; d="scan'208";a="109911987" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 20 Aug 2022 05:59:09 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Sat, 20 Aug 2022 05:59:06 -0700 Received: from ROB-ULT-M18064N.mchp-main.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Sat, 20 Aug 2022 05:59:03 -0700 From: Tudor Ambarus To: , , , CC: , , , , , , , , , Subject: [PATCH 30/33] dmaengine: at_hdmac: Check return code of dma_async_device_register Date: Sat, 20 Aug 2022 15:57:14 +0300 Message-ID: <20220820125717.588722-31-tudor.ambarus@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220820125717.588722-1-tudor.ambarus@microchip.com> References: <20220820125717.588722-1-tudor.ambarus@microchip.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" dma_async_device_register() can fail, check the return code and display an error. Signed-off-by: Tudor Ambarus --- drivers/dma/at_hdmac.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index 042c7cba74bb..0b473e6d161d 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c @@ -2353,7 +2353,11 @@ static int __init at_dma_probe(struct platform_devic= e *pdev) dma_has_cap(DMA_SLAVE, atdma->dma_device.cap_mask) ? "slave " : "", plat_dat->nr_channels); =20 - dma_async_device_register(&atdma->dma_device); + err =3D dma_async_device_register(&atdma->dma_device); + if (err) { + dev_err(&pdev->dev, "Unable to register: %d.\n", err); + goto err_dma_async_device_register; + } =20 /* * Do not return an error if the dmac node is not present in order to @@ -2373,6 +2377,7 @@ static int __init at_dma_probe(struct platform_device= *pdev) =20 err_of_dma_controller_register: dma_async_device_unregister(&atdma->dma_device); +err_dma_async_device_register: dma_pool_destroy(atdma->memset_pool); err_memset_pool_create: dma_pool_destroy(atdma->dma_desc_pool); --=20 2.25.1