From mboxrd@z Thu Jan 1 00:00:00 1970 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 39A7EC38A2D for ; Tue, 25 Oct 2022 09:14:00 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=S4zKZSs0uVpHXDjiJoePHN2mE5IfAB0LCDXaapS823Q=; b=Cfj/nVM94piBCG UyxxzIVElBH5/d9+Hf51TlWMc6HfICytbqDpNIJiHO4n/f6LoicAmg6wQRHdfPv9aFxHdFW7P8Tvn aUNYzcc/iW1eTTHkuiGOSoHlFA1wswJqqH6VT8BrxEDP2f3Ys5QAMcwQG7p6LzXntY4UFem5zesd0 zqRJhMxXEzFkyVO84tDVJhtkQ8As2ogUwqFxVDT/qbtf/w8uK7S2gG3XpIEOhbnywLtnmIQPR/o+c vtDW/AAH1ENWu1VCPgUavtNEBFf4A0nzLTVWtmS05oFvUTnnmX/ucHErHOxOOgTWcZEbnvAd4Qc2z xM6pwulyqXZIbKY+YSUw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1onFzJ-004TfY-AE; Tue, 25 Oct 2022 09:12:45 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1onFqp-004PRe-7o for linux-arm-kernel@lists.infradead.org; Tue, 25 Oct 2022 09:04:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1666688639; x=1698224639; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=oXpZ9eKaq68nqmZW2GmzFIDev696mazQ2FYejaSR4Ss=; b=UXFlh9jAuXSc5K34/Uun4cxOm1CKUOjO/5LJZ77Sao4A3PtRuMgT02C6 iNb3byDq3sxNr3g4YvFSC9oYX1vLglUBmunBpTZf5TNgZrQZeqz8ZtrKE 3JjkPsIvYpufkpDm1l1s9KTZYYOmekiH5rr+7rAxSYMKTPiamesn+iZ7p 73LVff/bsUSoMR08o0zC2gKVU1Vjo2JcOoDt4aJl1d3ZLnC8+7d61IWd2 XVnQJg2BZHkruFQnl4lauB9EfBF/CvjikaEHFWXBW56kQdLcwKqYLipn3 /pIXZTcPfl1xzdkfKLRXuOr3mz9In1kPGigXAafdL0Tavb/RtUCRexaOW g==; X-IronPort-AV: E=Sophos;i="5.95,211,1661842800"; d="scan'208";a="186273117" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 25 Oct 2022 02:03:58 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) 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; Tue, 25 Oct 2022 02:03:58 -0700 Received: from ROB-ULT-M18064N.mchp-main.com (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Tue, 25 Oct 2022 02:03:55 -0700 From: Tudor Ambarus To: , , Subject: [PATCH v2 15/32] dmaengine: at_hdmac: Check return code of dma_async_device_register Date: Tue, 25 Oct 2022 12:02:49 +0300 Message-ID: <20221025090306.297886-16-tudor.ambarus@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221025090306.297886-1-tudor.ambarus@microchip.com> References: <20221025090306.297886-1-tudor.ambarus@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221025_020359_335273_840C751A X-CRM114-Status: GOOD ( 12.42 ) 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: , Cc: Tudor Ambarus , maciej.sosnowski@intel.com, linux-kernel@vger.kernel.org, mripard@kernel.org, linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org, stable@vger.kernel.org, torfl6749@gmail.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org dma_async_device_register() can fail, check the return code and display an error. Fixes: dc78baa2b90b ("dmaengine: at_hdmac: new driver for the Atmel AHB DMA Controller") Signed-off-by: Tudor Ambarus Cc: stable@vger.kernel.org --- 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 afcbad3e1718..858bd64f1313 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c @@ -1928,7 +1928,11 @@ static int __init at_dma_probe(struct platform_device *pdev) dma_has_cap(DMA_SLAVE, atdma->dma_common.cap_mask) ? "slave " : "", plat_dat->nr_channels); - dma_async_device_register(&atdma->dma_common); + err = dma_async_device_register(&atdma->dma_common); + if (err) { + dev_err(&pdev->dev, "Unable to register: %d.\n", err); + goto err_dma_async_device_register; + } /* * Do not return an error if the dmac node is not present in order to @@ -1948,6 +1952,7 @@ static int __init at_dma_probe(struct platform_device *pdev) err_of_dma_controller_register: dma_async_device_unregister(&atdma->dma_common); +err_dma_async_device_register: dma_pool_destroy(atdma->memset_pool); err_memset_pool_create: dma_pool_destroy(atdma->dma_desc_pool); -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel