* [PATCH -next] drm/i915/gvt: fix return value check
@ 2016-10-19 16:18 ` Wei Yongjun
0 siblings, 0 replies; 4+ messages in thread
From: Wei Yongjun @ 2016-10-19 16:18 UTC (permalink / raw)
To: Daniel Vetter, Jani Nikula, David Airlie, Yulei Zhang,
Zhenyu Wang, Zhi Wang
Cc: Wei Yongjun, intel-gfx, dri-devel, linux-kernel
From: Wei Yongjun <weiyongjun1@huawei.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@huawei.com>
---
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)
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH -next] drm/i915/gvt: fix return value check
@ 2016-10-19 16:18 ` Wei Yongjun
0 siblings, 0 replies; 4+ messages in thread
From: Wei Yongjun @ 2016-10-19 16:18 UTC (permalink / raw)
To: Daniel Vetter, Jani Nikula, David Airlie, Yulei Zhang,
Zhenyu Wang, Zhi Wang
Cc: intel-gfx, Wei Yongjun, linux-kernel, dri-devel
From: Wei Yongjun <weiyongjun1@huawei.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@huawei.com>
---
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)
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 4+ messages in thread
* ✗ Fi.CI.BAT: warning for drm/i915/gvt: fix return value check
2016-10-19 16:18 ` Wei Yongjun
(?)
@ 2016-10-19 18:26 ` Patchwork
-1 siblings, 0 replies; 4+ messages in thread
From: Patchwork @ 2016-10-19 18:26 UTC (permalink / raw)
To: Wei Yongjun; +Cc: intel-gfx
== Series Details ==
Series: drm/i915/gvt: fix return value check
URL : https://patchwork.freedesktop.org/series/14033/
State : warning
== Summary ==
Series 14033v1 drm/i915/gvt: fix return value check
https://patchwork.freedesktop.org/api/1.0/series/14033/revisions/1/mbox/
Test kms_cursor_legacy:
Subgroup basic-busy-flip-before-cursor-legacy:
pass -> DMESG-WARN (fi-ilk-650)
Test kms_pipe_crc_basic:
Subgroup bad-nb-words-1:
pass -> DMESG-WARN (fi-ilk-650)
Subgroup bad-nb-words-3:
pass -> DMESG-WARN (fi-ilk-650)
Subgroup bad-pipe:
pass -> DMESG-WARN (fi-ilk-650)
Subgroup bad-source:
pass -> DMESG-WARN (fi-ilk-650)
Subgroup suspend-read-crc-pipe-b:
incomplete -> PASS (fi-snb-2600)
fi-bdw-5557u total:246 pass:231 dwarn:0 dfail:0 fail:0 skip:15
fi-bsw-n3050 total:246 pass:203 dwarn:1 dfail:0 fail:0 skip:42
fi-bxt-t5700 total:246 pass:216 dwarn:0 dfail:0 fail:0 skip:30
fi-byt-j1900 total:186 pass:160 dwarn:1 dfail:0 fail:1 skip:23
fi-byt-n2820 total:246 pass:209 dwarn:1 dfail:0 fail:1 skip:35
fi-hsw-4770 total:246 pass:224 dwarn:0 dfail:0 fail:0 skip:22
fi-hsw-4770r total:246 pass:223 dwarn:1 dfail:0 fail:0 skip:22
fi-ilk-650 total:246 pass:155 dwarn:29 dfail:0 fail:2 skip:60
fi-ivb-3520m total:246 pass:221 dwarn:0 dfail:0 fail:0 skip:25
fi-ivb-3770 total:246 pass:221 dwarn:0 dfail:0 fail:0 skip:25
fi-skl-6260u total:246 pass:232 dwarn:0 dfail:0 fail:0 skip:14
fi-skl-6700hq total:246 pass:219 dwarn:4 dfail:0 fail:0 skip:23
fi-skl-6700k total:246 pass:221 dwarn:1 dfail:0 fail:0 skip:24
fi-skl-6770hq total:246 pass:232 dwarn:0 dfail:0 fail:0 skip:14
fi-snb-2520m total:246 pass:210 dwarn:0 dfail:0 fail:0 skip:36
fi-snb-2600 total:246 pass:209 dwarn:0 dfail:0 fail:0 skip:37
Results at /archive/results/CI_IGT_test/Patchwork_2765/
21787266bd182df4c0d2067cf1b5c2379f61c24d drm-intel-nightly: 2016y-10m-19d-15h-39m-22s UTC integration manifest
933a4c2 drm/i915/gvt: fix return value check
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH -next] drm/i915/gvt: fix return value check
2016-10-19 16:18 ` Wei Yongjun
(?)
(?)
@ 2016-10-19 23:58 ` Zhenyu Wang
-1 siblings, 0 replies; 4+ messages in thread
From: Zhenyu Wang @ 2016-10-19 23:58 UTC (permalink / raw)
To: Wei Yongjun
Cc: Daniel Vetter, Jani Nikula, David Airlie, Yulei Zhang,
Zhenyu Wang, Zhi Wang, Wei Yongjun, intel-gfx, dri-devel,
linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1748 bytes --]
On 2016.10.19 16:18:03 +0000, Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@huawei.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@huawei.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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 163 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-10-20 0:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-19 16:18 [PATCH -next] drm/i915/gvt: fix return value check Wei Yongjun
2016-10-19 16:18 ` Wei Yongjun
2016-10-19 18:26 ` ✗ Fi.CI.BAT: warning for " Patchwork
2016-10-19 23:58 ` [PATCH -next] " Zhenyu Wang
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.