Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6195820ybi; Sun, 21 Jul 2019 11:34:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqzk6FT46gkcluAj/PdQOcAkzL/8NQUvaeFw3a9QqSdc+R0u4TuPx+0BaN/KETeTZBIAMJsr X-Received: by 2002:a17:90a:b011:: with SMTP id x17mr73241732pjq.113.1563734056540; Sun, 21 Jul 2019 11:34:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563734056; cv=none; d=google.com; s=arc-20160816; b=XOMUMBsIdR5caU8aEFaxZkohDzlynmy8WX0hM1rtlF0pX+XOFbEPhr8vnXaixPL+Hx tvhqZcGI8irP4WltobexMxZHSk/SRSzDgVi3u28uNgLMFvJQWRXzbhmn91bhwylVVxM/ U7y6ri893VPTiVstgPRxI9OI6u7RJi7nvoeLHlSqG8cRFstZVbEyyGp3e9UEHVEGFi3X ngrUP4fUcqxtXSgoKMyE07jJ/2jYmIBgRGqVVim7WJita+aIbf4PwB1d8+9/dPI6BYnZ 6UHVoIjryaNfS4+DTbrsOt5ecsf+3nWWOzJlNE2LVTrvFxIcaAdKlG4w10UlVIijCqjx O4SA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:to:from:date:dkim-signature; bh=RWwLZt/rt3rzH+QJKbsOFH6f0FNBf1yA2AONMe227Ak=; b=FuI5fzDOuKN9LFnh4M+gxJk3KGyXIG9wk9M9gfS5GwGhRrILSh1Xu2lbFb7comrzjh Wgx49FSdtH1Tws5vvq5gy6UJVJeVNHnw/QzSmQQYR21qihVVrFS68GNVmfgSB06CpjVO mjUcn6SaqtpiEn91ZMSzm6jQ6fx+MtexN95aXmiABzIHrIxBcLCL8r86IeLOsgy3HsDJ MtpJmX8XK9DsdIjnh2qwL+OCu5uVq7djyQN67sKf6eCfTxFtVL3z3PsR8jFkqmbihCnq M9PDm48l3RZDSnPDyQq9qTJ0nvYxLeX1kdOXCv0wLghi+8O/BAurvixji+ppaaLW4TCV zHtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=P2EYg2QA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i11si6647341plb.20.2019.07.21.11.34.00; Sun, 21 Jul 2019 11:34:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=P2EYg2QA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727036AbfGUSPn (ORCPT + 99 others); Sun, 21 Jul 2019 14:15:43 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:33179 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726484AbfGUSPm (ORCPT ); Sun, 21 Jul 2019 14:15:42 -0400 Received: by mail-pl1-f193.google.com with SMTP id c14so17976940plo.0 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=bHGnLr8+iFDf7D5PRCg8YdX5lLcmjMGUZQK4kaOQPU8ftBORIBkq3c6UI2d4mYZI6v qCDH0g75dO3oXNeOG13WjGVMRf4EIgTtfbe2yoE8akry7D0t503GqO5ODFAy9+UUNbxx 4Zd8Gn4wYcWNE/cP3cYUec6KBIznuRDGxKCVfr8n5IQPiNxsA3t3CQEgCSTLzKZXlX6r dPJ11XBarOV7pX94WIaBprGYzdWsNvYiH+6REs8tefvcFK7JVCdOWbmp6Xne/czyY7wd Y0K0y0iOfL4YCwC6xXWyl5/xX3T4h2BFSWAOZCZ3ONZgG/ViFaiyFiQnr7kP7GYx0q3L GRaQ== X-Gm-Message-State: APjAAAVKdbe3GFr47H22zJ+/Gh5HcTeNJpYfGZT64vU20dPI3SiB6UxV g1V2RVQYsYtMPgcIi0Q3P7Q= 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-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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