Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751821AbdITH0L (ORCPT ); Wed, 20 Sep 2017 03:26:11 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:35487 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751790AbdITH0J (ORCPT ); Wed, 20 Sep 2017 03:26:09 -0400 X-Google-Smtp-Source: AOwi7QDz8RKSG/vtqzuG2fktToUsT7ILKdCQIc66Ebs4YUlaHidzxtyH+LMisbq1fYqo9JLmSq6Rkg== From: Arvind Yadav 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 Message-Id: <1505892308-6843-2-git-send-email-arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1505892308-6843-1-git-send-email-arvind.yadav.cs@gmail.com> References: <1505892308-6843-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: 644 Lines: 22 kasprintf() can fail here and we must check its return value. Signed-off-by: Arvind Yadav --- 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