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 X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47A5BC76191 for ; Sun, 21 Jul 2019 18:15:47 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 1D401206BF for ; Sun, 21 Jul 2019 18:15:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="iGqVUP4t"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="P2EYg2QA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1D401206BF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:To:From :Date:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=4qtitcrCkZQxXIEPF/cM0623r3OVx6wLrcvJ/xH+Uok=; b=iGqVUP4tCgbOQp njdV7aM2IbsRomAtfwuG343hDzsgVSktjo+lbNX8yYIhJGWJA2KcM5HciRai+9b56Yf0W3nDqVeqs RspV4hEV593UwQpIoPO/vdAoOCiUmfWuTAMZUBfOfwr4tg3DF0vTW5dPs2XklSbDjauFyH0Ptgc4d v89GWOuOWhvxHBik6dvxlS/+Md1viM0Mll1pwFXbuNZzTM1khDdMr+YUKfsZncnrV6JyVefv3FEhM iaKhf/OqZnBRJ75jQQzpb/lmCpnkaROwlEPxj3GYzcXPuwVe2p1XS4rgfmNVCKueYObYpyycEmUYL 3pfIPV4BNPlSuqZLcEEg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hpGN8-0001OL-4w; Sun, 21 Jul 2019 18:15:46 +0000 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hpGN5-0001Ir-F4 for linux-arm-kernel@lists.infradead.org; Sun, 21 Jul 2019 18:15:44 +0000 Received: by mail-pl1-x643.google.com with SMTP id c2so18000838plz.13 for ; Sun, 21 Jul 2019 11:15:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=RWwLZt/rt3rzH+QJKbsOFH6f0FNBf1yA2AONMe227Ak=; b=P2EYg2QAnNUbU3edGEbUEtYVrJRG76A7b0Brz9dpH6TpPooOr0Jo1P0e8Gdft5T3dn PP/qZG+gyty4qKDJl0c1Vy8cbBApIuwPOUTFiBgPD8QyvXZt/IagX/d9+BkqvDZTl2il C+MUUBa0fm6EG3pqtQPCiWsu79ojKs/Jl1IOXAFaE2dwGRVxwosrUVk5A9AL9Owwcvdk fJe6vKUKzFReByV1D6poE8WPcJiyhlmsAWUdmhocaYsP3coFXxw4WkF8W83qcgY8jAMO qcktb+53nUerGJE2SkSn4Lc9+2bmJkG0FO/VzoOssUjCuP++aUiHOku1/669hBw6J3Ha hTRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=RWwLZt/rt3rzH+QJKbsOFH6f0FNBf1yA2AONMe227Ak=; b=cXM6ZyKfZKxggcqzCRc9Dfa4Hqw630/+lKYwgk1w1u037sMDpSF1v76XuxrA1ygKo1 ZAEXVdGNvTg58wvJQi4H34xAHljhKpGLWXvo0tYQddHrLR6SY7kjwH3jsSc3uyZs+H5V XLwg1qi6d6LPy77Se1Bg2hUV0kGBmiBGHqCH0Ru5SSAiSdxqGhYS4tXY3iLtmyqX0yO/ QV22PimcGsari3IWTyvgNDr0g0AcG1kumDUHmoad8c3+/f9YAAzjNrqIm4ObeDPPPiJw j62qRyLgPKMBHS4UupREdoSWxm8JJhkFRxmkZW4y2aZmWpuG0sOnWKHIb0aIvZdkqqya uQ9Q== X-Gm-Message-State: APjAAAXTMzqA7oIq9Ky4Heh1ga4KGgIsJ4pvb4bhgW4CvrKTMvDkw5TS 0t/tkdHpaVtIfPzez7xngNT9wpVt X-Google-Smtp-Source: APXvYqxsFR6/nJOopb1myYnRstaWcWMyoLeAJ5eu/0DJ3inVuljlHLs/0ckz4mLYB2FUulM73NnvJw== X-Received: by 2002:a17:902:124:: with SMTP id 33mr72747169plb.145.1563732942128; Sun, 21 Jul 2019 11:15:42 -0700 (PDT) Received: from hari-Inspiron-1545 ([183.83.86.126]) by smtp.gmail.com with ESMTPSA id 35sm38914619pgw.91.2019.07.21.11.15.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 21 Jul 2019 11:15:41 -0700 (PDT) Date: Sun, 21 Jul 2019 23:45:36 +0530 From: Hariprasad Kelam To: Thomas Gleixner , Jason Cooper , Marc Zyngier , Marc Gonzalez , Mans Rullgard , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] irqchip/tango: Add NULL check after memory operation Message-ID: <20190721181536.GA13450@hari-Inspiron-1545> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190721_111543_535230_B17FC6F3 X-CRM114-Status: GOOD ( 10.17 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add NULL check after kzalloc operation. Fix below issue reported by coccicheck ./drivers/irqchip/irq-tango.c:189:1-5: alloc with no test, possible model on line 193 Signed-off-by: Hariprasad Kelam --- drivers/irqchip/irq-tango.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/irqchip/irq-tango.c b/drivers/irqchip/irq-tango.c index 34290f0..761b9fa 100644 --- a/drivers/irqchip/irq-tango.c +++ b/drivers/irqchip/irq-tango.c @@ -187,6 +187,8 @@ static int __init tangox_irq_init(void __iomem *base, struct resource *baseres, panic("%pOFn: failed to get address", node); chip = kzalloc(sizeof(*chip), GFP_KERNEL); + if (!chip) + return -ENOMEM; chip->ctl = res.start - baseres->start; chip->base = base; -- 2.7.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel