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] [day] [month] [year] [list]
Date:	Tue, 19 Jul 2016 14:25:52 +0200
From:	Christian König <christian.koenig@....com>
To:	Wei Yongjun <weiyj_lk@....com>, <alexander.deucher@....com>,
	<airlied@...ux.ie>, <tom.stdenis@....com>, <Jammy.Zhou@....com>,
	<David1.Zhou@....com>, <Monk.Liu@....com>, <Jerry.Zhang@....com>
CC:	Wei Yongjun <yongjun_wei@...ndmicro.com.cn>,
	<dri-devel@...ts.freedesktop.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH -next] drm/amdgpu: fix return value check in
 amdgpu_debugfs_ring_init()

Am 19.07.2016 um 14:15 schrieb Wei Yongjun:
> From: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>
>
> In case of error, the function debugfs_create_*() 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.
> (defined(CONFIG_DEBUG_FS) make sure debugfs is enabled)
>
> Signed-off-by: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>
Reviewed-by: Christian König <christian.koenig@....com>.

There might be some more cases like this, we have probably copy&pasted 
that code multiple times.

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
> index 3b885e3..9247ae16 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
> @@ -362,8 +362,8 @@ static int amdgpu_debugfs_ring_init(struct amdgpu_device *adev,
>   	ent = debugfs_create_file(name,
>   				  S_IFREG | S_IRUGO, root,
>   				  ring, &amdgpu_debugfs_ring_fops);
> -	if (IS_ERR(ent))
> -		return PTR_ERR(ent);
> +	if (!ent)
> +		return -ENOMEM;
>   
>   	i_size_write(ent->d_inode, ring->ring_size + 12);
>   	ring->ent = ent;
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ