lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170921112211.GG4914@intel.com>
Date:   Thu, 21 Sep 2017 14:22:11 +0300
From:   Ville Syrjälä <ville.syrjala@...ux.intel.com>
To:     Arvind Yadav <arvind.yadav.cs@...il.com>
Cc:     thierry.reding@...il.com, airlied@...ux.ie, jonathanh@...dia.com,
        daniel.vetter@...el.com, jani.nikula@...ux.intel.com,
        seanpaul@...omium.org, linux-kernel@...r.kernel.org,
        dri-devel@...ts.freedesktop.org
Subject: Re: [PATCH 1/2] drm: tegra: dc: Handle return value of kasprintf

On Wed, Sep 20, 2017 at 12:55:07PM +0530, Arvind Yadav wrote:
> kasprintf() can fail here and we must check its return value.
> 
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@...il.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);

Indeed, doesn't look like debugfs_create_dir() can be safely called w/
name==NULL.

Reviewed-by: Ville Syrjälä <ville.syrjala@...ux.intel.com>

>  	kfree(name);
>  
> -- 
> 1.9.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@...ts.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Ville Syrjälä
Intel OTC

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ