Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751828AbdITIJZ (ORCPT ); Wed, 20 Sep 2017 04:09:25 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:35418 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751554AbdITIJV (ORCPT ); Wed, 20 Sep 2017 04:09:21 -0400 X-Google-Smtp-Source: AOwi7QBHXQQsZuXHCMGm+jDvlAl3vrE18rR5CWKO1KbhjF0WJJvEpfpsHpSO9wqTr05362w4Lg3+fQ== From: Arvind Yadav To: tglx@linutronix.de, jason@lakedaemon.net, marc.zyngier@arm.com, vz@mleia.com, slemieux.tyco@gmail.com Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/4] irqchip/gic-v3-its: Handle return value of kasprintf Date: Wed, 20 Sep 2017 13:38:19 +0530 Message-Id: <1505894901-9403-2-git-send-email-arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1505894901-9403-1-git-send-email-arvind.yadav.cs@gmail.com> References: <1505894901-9403-1-git-send-email-arvind.yadav.cs@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 846 Lines: 23 kasprintf() can fail here and we must check its return value. Signed-off-by: Arvind Yadav --- drivers/irqchip/irq-gic-v3-its-pci-msi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/irqchip/irq-gic-v3-its-pci-msi.c b/drivers/irqchip/irq-gic-v3-its-pci-msi.c index 14a8c0a..f703069 100644 --- a/drivers/irqchip/irq-gic-v3-its-pci-msi.c +++ b/drivers/irqchip/irq-gic-v3-its-pci-msi.c @@ -158,6 +158,9 @@ static int __init its_pci_of_msi_init(void) its_entry = (struct acpi_madt_generic_translator *)header; node_name = kasprintf(GFP_KERNEL, "ITS@0x%lx", (long)its_entry->base_address); + if (!node_name) + return -ENOMEM; + dom_handle = iort_find_domain_token(its_entry->translation_id); if (!dom_handle) { pr_err("%s: Unable to locate ITS domain handle\n", node_name); -- 1.9.1