From: Arvind Yadav <arvind.yadav.cs@gmail.com>
To: thierry.reding@gmail.com, airlied@linux.ie, jonathanh@nvidia.com,
daniel.vetter@intel.com, jani.nikula@linux.intel.com,
seanpaul@chromium.org
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] drm: tegra: dc: Handle return value of kasprintf
Date: Wed, 20 Sep 2017 12:55:07 +0530 [thread overview]
Message-ID: <1505892308-6843-2-git-send-email-arvind.yadav.cs@gmail.com> (raw)
In-Reply-To: <1505892308-6843-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/gpu/drm/tegra/dc.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
index 4df3911..f3214a1 100644
--- a/drivers/gpu/drm/tegra/dc.c
+++ b/drivers/gpu/drm/tegra/dc.c
@@ -1695,6 +1695,8 @@ static int tegra_dc_debugfs_init(struct tegra_dc *dc, struct drm_minor *minor)
int err;
name = kasprintf(GFP_KERNEL, "dc.%d", dc->pipe);
+ if (!name)
+ return -ENOMEM;
dc->debugfs = debugfs_create_dir(name, minor->debugfs_root);
kfree(name);
--
1.9.1
next prev parent reply other threads:[~2017-09-20 7:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-20 7:25 [PATCH 0/2] Handle / Release memory obtained by kasprintf Arvind Yadav
2017-09-20 7:25 ` Arvind Yadav [this message]
2017-09-21 11:22 ` [PATCH 1/2] drm: tegra: dc: Handle return value of kasprintf Ville Syrjälä
2017-09-20 7:25 ` [PATCH 2/2] drm: Release memory obtained by kasprintf Arvind Yadav
2017-09-21 11:24 ` Ville Syrjälä
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=1505892308-6843-2-git-send-email-arvind.yadav.cs@gmail.com \
--to=arvind.yadav.cs@gmail.com \
--cc=airlied@linux.ie \
--cc=daniel.vetter@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=jonathanh@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=seanpaul@chromium.org \
--cc=thierry.reding@gmail.com \
/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
all inboxes | Powered by JetHome®