From patchwork Fri Jun 30 07:55:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gustavo A. R. Silva" X-Patchwork-Id: 9818673 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 017116035F for ; Fri, 30 Jun 2017 08:19:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E9B7B285D8 for ; Fri, 30 Jun 2017 08:19:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DE2852860A; Fri, 30 Jun 2017 08:19:48 +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,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 69BA2285D8 for ; Fri, 30 Jun 2017 08:19:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751790AbdF3ITs (ORCPT ); Fri, 30 Jun 2017 04:19:48 -0400 Received: from gateway32.websitewelcome.com ([192.185.145.108]:21100 "EHLO gateway32.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751729AbdF3ITr (ORCPT ); Fri, 30 Jun 2017 04:19:47 -0400 X-Greylist: delayed 1480 seconds by postgrey-1.27 at vger.kernel.org; Fri, 30 Jun 2017 04:19:47 EDT Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway32.websitewelcome.com (Postfix) with ESMTP id A182DF6F02 for ; Fri, 30 Jun 2017 02:55:04 -0500 (CDT) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id QqoTdIQ4SlnDaQqoTdy1qh; Fri, 30 Jun 2017 02:58:01 -0500 Received: from [189.152.189.231] (port=51508 helo=embeddedgus) by gator4166.hostgator.com with esmtpa (Exim 4.87) (envelope-from ) id 1dQqlc-003HJx-Ei; Fri, 30 Jun 2017 02:55:04 -0500 Date: Fri, 30 Jun 2017 02:55:03 -0500 From: "Gustavo A. R. Silva" To: Dan Williams , Vinod Koul Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" Subject: [PATCH] dmaengine: zx: add check on platform_get_irq return value Message-ID: <20170630075502.GA27661@embeddedgus> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 189.152.189.231 X-Exim-ID: 1dQqlc-003HJx-Ei X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedgus) [189.152.189.231]:51508 X-Source-Auth: garsilva@embeddedor.com X-Email-Count: 35 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Check return value from call to platform_get_irq(), so in case of failure print error message and propagate the return value. Signed-off-by: Gustavo A. R. Silva --- drivers/dma/zx_dma.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/dma/zx_dma.c b/drivers/dma/zx_dma.c index 2bb6953..26196de 100644 --- a/drivers/dma/zx_dma.c +++ b/drivers/dma/zx_dma.c @@ -786,6 +786,11 @@ static int zx_dma_probe(struct platform_device *op) } d->irq = platform_get_irq(op, 0); + if (d->irq < 0) { + dev_err(&op->dev, "failed to get IRQ: %d\n", d->irq); + return d->irq; + } + ret = devm_request_irq(&op->dev, d->irq, zx_dma_int_handler, 0, DRIVER_NAME, d); if (ret)