From patchwork Thu Aug 17 21:12:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 9907157 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 5901B6024A for ; Thu, 17 Aug 2017 21:11:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4B90628BD8 for ; Thu, 17 Aug 2017 21:11:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 40A1B28BDD; Thu, 17 Aug 2017 21:11:45 +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.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 9B5B328BD8 for ; Thu, 17 Aug 2017 21:11:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753586AbdHQVLn (ORCPT ); Thu, 17 Aug 2017 17:11:43 -0400 Received: from mail-qk0-f193.google.com ([209.85.220.193]:36121 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753442AbdHQVLm (ORCPT ); Thu, 17 Aug 2017 17:11:42 -0400 Received: by mail-qk0-f193.google.com with SMTP id d21so5754732qke.3 for ; Thu, 17 Aug 2017 14:11:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=uqOchPUZwZT2UQhvb1sU9r6/Oa1xA1dKG7dx1SPMe3w=; b=NsedBzQOJFrZg0I+5XCY1IAoiCeimPd7b9chSF2plv7W8hFjXDIbYPr1gzUV70fYcu vOWejA0B4JaN1Yul+nt24sZTSRwqfKaGHpPAQj8c9k3TjWXumxwT4Wk3YJnHpDpaQzLI cD0002fzA8GK513yNRYancDm/Tg84UEcm4Ibx9nR++vkSozvIeWwbeIGSZ5L/PXJlMHj ec6Qdz3nzOXzUWausBQ7zdhnKv02HCUuRnBXyfQHhpyyUAgIYEwLCMb8emPO1Of3LLbj 1m2D+XgmoxwHuAhnDvz3e+dxmRmtwOGykyksxyX8Hzfr8p89Di4VuLhh1s9FCeZ73CL/ lGbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=uqOchPUZwZT2UQhvb1sU9r6/Oa1xA1dKG7dx1SPMe3w=; b=bGs+fQxISDx8iRNSQ4mYe3nSDaEyRF2dWAo9G/0sd2ansK1X/Rk963VC1SpXDji72/ lE1sDtS1QUn4o+1veLXiIZg6CItd6L36hvpeKMFoDSrVaNqBcJ04ESdp++TVanPU98Z4 497qQEAu3nQL5F2YCFD3P8ehwlLOxpc4OKZbxhQCMh37R6T2i1q/X/toxb2NG8+VHkOP vVyj2330rI55gBUKd2H2i9eexE0L9kNQgwISrc+iARo6ExY8rArEb1WrgftobOPuciJs Z1T6t8NRrEWKVnJRTgv7inn/mMs2yGuj4UWJ33miFA7+Osy/aeCLG2yJNiiq7W6+jOtf M7TQ== X-Gm-Message-State: AHYfb5glmpUHTEkOMrJoUaDTBTTsWphT8vdUSdamVB2IU98nWWkq1d2H qUzkVdmxi5bmaz0v X-Received: by 10.55.129.135 with SMTP id c129mr8724670qkd.11.1503004301731; Thu, 17 Aug 2017 14:11:41 -0700 (PDT) Received: from localhost.localdomain ([187.180.181.203]) by smtp.gmail.com with ESMTPSA id e39sm2800928qtb.8.2017.08.17.14.11.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 17 Aug 2017 14:11:41 -0700 (PDT) From: Fabio Estevam To: mchehab@kernel.org Cc: linux-media@vger.kernel.org, p.zabel@pengutronix.de, Fabio Estevam Subject: [PATCH] [media] mx2_emmaprp: Check for platform_get_irq() error Date: Thu, 17 Aug 2017 18:12:05 -0300 Message-Id: <1503004325-23655-1-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Fabio Estevam platform_get_irq() may fail, so we should better check its return value and propagate it in the case of error. Signed-off-by: Fabio Estevam --- drivers/media/platform/mx2_emmaprp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/platform/mx2_emmaprp.c b/drivers/media/platform/mx2_emmaprp.c index 03e47e0..f90eaa0 100644 --- a/drivers/media/platform/mx2_emmaprp.c +++ b/drivers/media/platform/mx2_emmaprp.c @@ -942,6 +942,8 @@ static int emmaprp_probe(struct platform_device *pdev) platform_set_drvdata(pdev, pcdev); irq = platform_get_irq(pdev, 0); + if (irq < 0) + return irq; ret = devm_request_irq(&pdev->dev, irq, emmaprp_irq, 0, dev_name(&pdev->dev), pcdev); if (ret)