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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20131216110655.GB26921@strange.amr.corp.intel.com>
Date:	Mon, 16 Dec 2013 11:06:55 +0000
From:	Damien Lespiau <damien.lespiau@...el.com>
To:	Wei Yongjun <weiyj.lk@...il.com>
Cc:	daniel.vetter@...ll.ch, airlied@...ux.ie,
	yongjun_wei@...ndmicro.com.cn, intel-gfx@...ts.freedesktop.org,
	dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [Intel-gfx] [PATCH -next] drm/i915: fix return value check of
 debugfs_create_file()

On Mon, Dec 16, 2013 at 02:13:25PM +0800, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>
> 
> In case of error, the function debugfs_create_file() returns NULL
> pointer not ERR_PTR() if debugfs is enabled. The IS_ERR() test in
> the return value check should be replaced with NULL test.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>

Reviewed-by: Damien Lespiau <damien.lespiau@...el.com>

-- 
Damien

> ---
>  drivers/gpu/drm/i915/i915_debugfs.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 7008aac..856e18b 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -1920,8 +1920,8 @@ static int i915_pipe_crc_create(struct dentry *root, struct drm_minor *minor,
>  	info->dev = dev;
>  	ent = debugfs_create_file(info->name, S_IRUGO, root, info,
>  				  &i915_pipe_crc_fops);
> -	if (IS_ERR(ent))
> -		return PTR_ERR(ent);
> +	if (!ent)
> +		return -ENOMEM;
>  
>  	return drm_add_fake_info_node(minor, ent, info);
>  }
> @@ -2931,8 +2931,8 @@ static int i915_forcewake_create(struct dentry *root, struct drm_minor *minor)
>  				  S_IRUSR,
>  				  root, dev,
>  				  &i915_forcewake_fops);
> -	if (IS_ERR(ent))
> -		return PTR_ERR(ent);
> +	if (!ent)
> +		return -ENOMEM;
>  
>  	return drm_add_fake_info_node(minor, ent, &i915_forcewake_fops);
>  }
> @@ -2949,8 +2949,8 @@ static int i915_debugfs_create(struct dentry *root,
>  				  S_IRUGO | S_IWUSR,
>  				  root, dev,
>  				  fops);
> -	if (IS_ERR(ent))
> -		return PTR_ERR(ent);
> +	if (!ent)
> +		return -ENOMEM;
>  
>  	return drm_add_fake_info_node(minor, ent, fops);
>  }
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@...ts.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ