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]
Date:   Thu, 20 Oct 2016 07:58:16 +0800
From:   Zhenyu Wang <zhenyuw@...ux.intel.com>
To:     Wei Yongjun <weiyj.lk@...il.com>
Cc:     Daniel Vetter <daniel.vetter@...el.com>,
        Jani Nikula <jani.nikula@...ux.intel.com>,
        David Airlie <airlied@...ux.ie>,
        Yulei Zhang <yulei.zhang@...el.com>,
        Zhenyu Wang <zhenyuw@...ux.intel.com>,
        Zhi Wang <zhi.a.wang@...el.com>,
        Wei Yongjun <weiyongjun1@...wei.com>,
        intel-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH -next] drm/i915/gvt: fix return value check

On 2016.10.19 16:18:03 +0000, Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@...wei.com>
> 
> In case of error, the function i915_gem_object_create() returns
> ERR_PTR() not NULL. The NULL test in the return value check should
> be replaced with IS_ERR().
> 
> Signed-off-by: Wei Yongjun <weiyongjun1@...wei.com>

Hi, Yongjun, we've already had this fixed in our queue for next pull request,
will send very soon.

Thanks.

> ---
>  drivers/gpu/drm/i915/gvt/cmd_parser.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gvt/cmd_parser.c b/drivers/gpu/drm/i915/gvt/cmd_parser.c
> index 5808ee7..6abb2a6 100644
> --- a/drivers/gpu/drm/i915/gvt/cmd_parser.c
> +++ b/drivers/gpu/drm/i915/gvt/cmd_parser.c
> @@ -1640,8 +1640,8 @@ static int perform_bb_shadow(struct parser_exec_state *s)
>  
>  	entry_obj->obj = i915_gem_object_create(&(s->vgpu->gvt->dev_priv->drm),
>  		round_up(bb_size, PAGE_SIZE));
> -	if (entry_obj->obj == NULL)
> -		return -ENOMEM;
> +	if (IS_ERR(entry_obj->obj))
> +		return PTR_ERR(entry_obj->obj);
>  	entry_obj->len = bb_size;
>  	INIT_LIST_HEAD(&entry_obj->list);
>  
> @@ -2712,8 +2712,8 @@ static int shadow_indirect_ctx(struct intel_shadow_wa_ctx *wa_ctx)
>  
>  	wa_ctx->indirect_ctx.obj = i915_gem_object_create(dev,
>  			round_up(ctx_size + CACHELINE_BYTES, PAGE_SIZE));
> -	if (wa_ctx->indirect_ctx.obj == NULL)
> -		return -ENOMEM;
> +	if (IS_ERR(wa_ctx->indirect_ctx.obj))
> +		return PTR_ERR(wa_ctx->indirect_ctx.obj);
>  
>  	ret = i915_gem_object_get_pages(wa_ctx->indirect_ctx.obj);
>  	if (ret)
> 

-- 
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827

Download attachment "signature.asc" of type "application/pgp-signature" (164 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ