All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: Wei Yongjun <weiyj_lk@163.com>,
	alexander.deucher@amd.com, airlied@linux.ie, David1.Zhou@amd.com,
	Felix.Kuehling@amd.com, Jammy.Zhou@amd.com
Cc: Wei Yongjun <yongjun_wei@trendmicro.com.cn>,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH -next] drm/amdgpu: fix return value check in amdgpu_ttm_debugfs_init()
Date: Tue, 19 Jul 2016 14:26:32 +0200	[thread overview]
Message-ID: <578E1C78.2000502@amd.com> (raw)
In-Reply-To: <1468930534-10432-1-git-send-email-weiyj_lk@163.com>

Am 19.07.2016 um 14:15 schrieb Wei Yongjun:
> From: Wei Yongjun <yongjun_wei@trendmicro.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.
> (defined(CONFIG_DEBUG_FS) make sure debugfs is enabled)
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> index b7742e6..8c569ea 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> @@ -1345,16 +1345,16 @@ static int amdgpu_ttm_debugfs_init(struct amdgpu_device *adev)
>   
>   	ent = debugfs_create_file("amdgpu_vram", S_IFREG | S_IRUGO, root,
>   				  adev, &amdgpu_ttm_vram_fops);
> -	if (IS_ERR(ent))
> -		return PTR_ERR(ent);
> +	if (!ent)
> +		return -ENOMEM;
>   	i_size_write(ent->d_inode, adev->mc.mc_vram_size);
>   	adev->mman.vram = ent;
>   
>   #ifdef CONFIG_DRM_AMDGPU_GART_DEBUGFS
>   	ent = debugfs_create_file("amdgpu_gtt", S_IFREG | S_IRUGO, root,
>   				  adev, &amdgpu_ttm_gtt_fops);
> -	if (IS_ERR(ent))
> -		return PTR_ERR(ent);
> +	if (!ent)
> +		return -ENOMEM;
>   	i_size_write(ent->d_inode, adev->mc.gtt_size);
>   	adev->mman.gtt = ent;
>
>

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: "Christian König" <christian.koenig@amd.com>
To: Wei Yongjun <weiyj_lk@163.com>, <alexander.deucher@amd.com>,
	<airlied@linux.ie>, <David1.Zhou@amd.com>,
	<Felix.Kuehling@amd.com>, <Jammy.Zhou@amd.com>
Cc: Wei Yongjun <yongjun_wei@trendmicro.com.cn>,
	<dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH -next] drm/amdgpu: fix return value check in amdgpu_ttm_debugfs_init()
Date: Tue, 19 Jul 2016 14:26:32 +0200	[thread overview]
Message-ID: <578E1C78.2000502@amd.com> (raw)
In-Reply-To: <1468930534-10432-1-git-send-email-weiyj_lk@163.com>

Am 19.07.2016 um 14:15 schrieb Wei Yongjun:
> From: Wei Yongjun <yongjun_wei@trendmicro.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.
> (defined(CONFIG_DEBUG_FS) make sure debugfs is enabled)
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> index b7742e6..8c569ea 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> @@ -1345,16 +1345,16 @@ static int amdgpu_ttm_debugfs_init(struct amdgpu_device *adev)
>   
>   	ent = debugfs_create_file("amdgpu_vram", S_IFREG | S_IRUGO, root,
>   				  adev, &amdgpu_ttm_vram_fops);
> -	if (IS_ERR(ent))
> -		return PTR_ERR(ent);
> +	if (!ent)
> +		return -ENOMEM;
>   	i_size_write(ent->d_inode, adev->mc.mc_vram_size);
>   	adev->mman.vram = ent;
>   
>   #ifdef CONFIG_DRM_AMDGPU_GART_DEBUGFS
>   	ent = debugfs_create_file("amdgpu_gtt", S_IFREG | S_IRUGO, root,
>   				  adev, &amdgpu_ttm_gtt_fops);
> -	if (IS_ERR(ent))
> -		return PTR_ERR(ent);
> +	if (!ent)
> +		return -ENOMEM;
>   	i_size_write(ent->d_inode, adev->mc.gtt_size);
>   	adev->mman.gtt = ent;
>
>

  reply	other threads:[~2016-07-19 12:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-19 12:15 [PATCH -next] drm/amdgpu: fix return value check in amdgpu_ttm_debugfs_init() Wei Yongjun
2016-07-19 12:26 ` Christian König [this message]
2016-07-19 12:26   ` Christian König

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=578E1C78.2000502@amd.com \
    --to=christian.koenig@amd.com \
    --cc=David1.Zhou@amd.com \
    --cc=Felix.Kuehling@amd.com \
    --cc=Jammy.Zhou@amd.com \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=weiyj_lk@163.com \
    --cc=yongjun_wei@trendmicro.com.cn \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.