linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: arvind.yadav.cs@gmail.com (Arvind Yadav)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/4] irqchip/gic-v3-its-platform-msi: Handle return value of kasprintf
Date: Wed, 20 Sep 2017 13:38:20 +0530	[thread overview]
Message-ID: <1505894901-9403-3-git-send-email-arvind.yadav.cs@gmail.com> (raw)
In-Reply-To: <1505894901-9403-1-git-send-email-arvind.yadav.cs@gmail.com>

kasprintf() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/irqchip/irq-gic-v3-its-platform-msi.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/irqchip/irq-gic-v3-its-platform-msi.c b/drivers/irqchip/irq-gic-v3-its-platform-msi.c
index 833a90f..a731f82 100644
--- a/drivers/irqchip/irq-gic-v3-its-platform-msi.c
+++ b/drivers/irqchip/irq-gic-v3-its-platform-msi.c
@@ -126,6 +126,9 @@ static int __init its_pmsi_init_one(struct fwnode_handle *fwnode,
 	its_entry = (struct acpi_madt_generic_translator *)header;
 	node_name = kasprintf(GFP_KERNEL, "ITS at 0x%lx",
 			      (long)its_entry->base_address);
+	if (!node_name)
+		return -ENOMEM;
+
 	domain_handle = iort_find_domain_token(its_entry->translation_id);
 	if (!domain_handle) {
 		pr_err("%s: Unable to locate ITS domain handle\n", node_name);
-- 
1.9.1

  parent reply	other threads:[~2017-09-20  8:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-20  8:08 [PATCH 0/4] iirqchip: Handle return value of kasprintf Arvind Yadav
2017-09-20  8:08 ` [PATCH 1/4] irqchip/gic-v3-its: " Arvind Yadav
2017-09-20  8:08 ` Arvind Yadav [this message]
2017-09-20  8:08 ` [PATCH 3/4] irqchip/gic: " Arvind Yadav
2017-09-22  8:10 ` [PATCH 0/4] iirqchip: " Marc Zyngier
2017-09-22  8:57   ` Arvind Yadav

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1505894901-9403-3-git-send-email-arvind.yadav.cs@gmail.com \
    --to=arvind.yadav.cs@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).