Re: [PATCH][drm-next] drm/i915/gvt: ensure -ve return value is handled correctly

2017-09-25 Thread Joonas Lahtinen
On Fri, 2017-09-22 at 17:50 +, Wang, Zhi A wrote: > Thanks for the reply. Learned a lot. :) > > GEM_BUG_ON is new to me since it wasn't there at the beginning of > GVT-g upstream. It showed up later. So I left a lot of WARN_ON in the > code and some of them should be GEM_BUG_ON now. > > Now

Re: [PATCH][drm-next] drm/i915/gvt: ensure -ve return value is handled correctly

2017-09-25 Thread Joonas Lahtinen
On Fri, 2017-09-22 at 17:50 +, Wang, Zhi A wrote: > Thanks for the reply. Learned a lot. :) > > GEM_BUG_ON is new to me since it wasn't there at the beginning of > GVT-g upstream. It showed up later. So I left a lot of WARN_ON in the > code and some of them should be GEM_BUG_ON now. > > Now

RE: [PATCH][drm-next] drm/i915/gvt: ensure -ve return value is handled correctly

2017-09-22 Thread Wang, Zhi A
vger.kernel.org; linux-kernel@vger.kernel.org; Jani Nikula <jani.nik...@linux.intel.com>; dri-de...@lists.freedesktop.org; Vivi, Rodrigo <rodrigo.v...@intel.com>; Colin King <colin.k...@canonical.com>; intel-gvt-...@lists.freedesktop.org Subject: Re: [PATCH][drm-next] drm/i915/gvt: ensur

RE: [PATCH][drm-next] drm/i915/gvt: ensure -ve return value is handled correctly

2017-09-22 Thread Wang, Zhi A
-...@lists.freedesktop.org Subject: Re: [PATCH][drm-next] drm/i915/gvt: ensure -ve return value is handled correctly On Thu, 2017-09-21 at 16:17 +, Wang, Zhi A wrote: > Hi Joonas: > > Thanks for the introduction. I have been thinking about the > possibility of introducing GEM_BUG_O

Re: [PATCH][drm-next] drm/i915/gvt: ensure -ve return value is handled correctly

2017-09-22 Thread Joonas Lahtinen
On Thu, 2017-09-21 at 16:17 +, Wang, Zhi A wrote: > Hi Joonas: > > Thanks for the introduction. I have been thinking about the > possibility of introducing GEM_BUG_ON into GVT-g recently and > investigating on it. I'm just a bit confused about the usage between > GEM_BUG_ON and WARN_ON.

Re: [PATCH][drm-next] drm/i915/gvt: ensure -ve return value is handled correctly

2017-09-22 Thread Joonas Lahtinen
On Thu, 2017-09-21 at 16:17 +, Wang, Zhi A wrote: > Hi Joonas: > > Thanks for the introduction. I have been thinking about the > possibility of introducing GEM_BUG_ON into GVT-g recently and > investigating on it. I'm just a bit confused about the usage between > GEM_BUG_ON and WARN_ON.

RE: [PATCH][drm-next] drm/i915/gvt: ensure -ve return value is handled correctly

2017-09-21 Thread Wang, Zhi A
..@lists.freedesktop.org; Vivi, Rodrigo <rodrigo.v...@intel.com>; Colin King <colin.k...@canonical.com>; intel-gvt-...@lists.freedesktop.org; Wang, Zhi A <zhi.a.w...@intel.com> Subject: Re: [PATCH][drm-next] drm/i915/gvt: ensure -ve return value is handled correctly On T

RE: [PATCH][drm-next] drm/i915/gvt: ensure -ve return value is handled correctly

2017-09-21 Thread Wang, Zhi A
/gvt: ensure -ve return value is handled correctly On Thu, 2017-09-21 at 06:44 +0800, Zhenyu Wang wrote: > On 2017.09.19 19:35:23 -0700, Joe Perches wrote: > > On Wed, 2017-09-20 at 05:46 +0800, Zhenyu Wang wrote: > > > On 2017.09.19 16:55:34 +0100, Colin King wrote: > >

Re: [PATCH][drm-next] drm/i915/gvt: ensure -ve return value is handled correctly

2017-09-21 Thread Joonas Lahtinen
On Thu, 2017-09-21 at 06:44 +0800, Zhenyu Wang wrote: > On 2017.09.19 19:35:23 -0700, Joe Perches wrote: > > On Wed, 2017-09-20 at 05:46 +0800, Zhenyu Wang wrote: > > > On 2017.09.19 16:55:34 +0100, Colin King wrote: > > > > From: Colin Ian King > > > > > > > > An

Re: [PATCH][drm-next] drm/i915/gvt: ensure -ve return value is handled correctly

2017-09-21 Thread Joonas Lahtinen
On Thu, 2017-09-21 at 06:44 +0800, Zhenyu Wang wrote: > On 2017.09.19 19:35:23 -0700, Joe Perches wrote: > > On Wed, 2017-09-20 at 05:46 +0800, Zhenyu Wang wrote: > > > On 2017.09.19 16:55:34 +0100, Colin King wrote: > > > > From: Colin Ian King > > > > > > > > An earlier fix changed the return

Re: [PATCH][drm-next] drm/i915/gvt: ensure -ve return value is handled correctly

2017-09-20 Thread Zhenyu Wang
On 2017.09.19 19:35:23 -0700, Joe Perches wrote: > On Wed, 2017-09-20 at 05:46 +0800, Zhenyu Wang wrote: > > On 2017.09.19 16:55:34 +0100, Colin King wrote: > > > From: Colin Ian King > > > > > > An earlier fix changed the return type from find_bb_size however the > > >

Re: [PATCH][drm-next] drm/i915/gvt: ensure -ve return value is handled correctly

2017-09-20 Thread Zhenyu Wang
On 2017.09.19 19:35:23 -0700, Joe Perches wrote: > On Wed, 2017-09-20 at 05:46 +0800, Zhenyu Wang wrote: > > On 2017.09.19 16:55:34 +0100, Colin King wrote: > > > From: Colin Ian King > > > > > > An earlier fix changed the return type from find_bb_size however the > > > integer return is being

Re: [PATCH][drm-next] drm/i915/gvt: ensure -ve return value is handled correctly

2017-09-19 Thread Joe Perches
On Wed, 2017-09-20 at 05:46 +0800, Zhenyu Wang wrote: > On 2017.09.19 16:55:34 +0100, Colin King wrote: > > From: Colin Ian King > > > > An earlier fix changed the return type from find_bb_size however the > > integer return is being assigned to a unsigned int so the

Re: [PATCH][drm-next] drm/i915/gvt: ensure -ve return value is handled correctly

2017-09-19 Thread Joe Perches
On Wed, 2017-09-20 at 05:46 +0800, Zhenyu Wang wrote: > On 2017.09.19 16:55:34 +0100, Colin King wrote: > > From: Colin Ian King > > > > An earlier fix changed the return type from find_bb_size however the > > integer return is being assigned to a unsigned int so the -ve error > > check will

Re: [PATCH][drm-next] drm/i915/gvt: ensure -ve return value is handled correctly

2017-09-19 Thread Zhenyu Wang
On 2017.09.19 16:55:34 +0100, Colin King wrote: > From: Colin Ian King > > An earlier fix changed the return type from find_bb_size however the > integer return is being assigned to a unsigned int so the -ve error > check will never be detected. Make bb_size an int to

Re: [PATCH][drm-next] drm/i915/gvt: ensure -ve return value is handled correctly

2017-09-19 Thread Zhenyu Wang
On 2017.09.19 16:55:34 +0100, Colin King wrote: > From: Colin Ian King > > An earlier fix changed the return type from find_bb_size however the > integer return is being assigned to a unsigned int so the -ve error > check will never be detected. Make bb_size an int to fix this. > > Detected by

[PATCH][drm-next] drm/i915/gvt: ensure -ve return value is handled correctly

2017-09-19 Thread Colin King
From: Colin Ian King An earlier fix changed the return type from find_bb_size however the integer return is being assigned to a unsigned int so the -ve error check will never be detected. Make bb_size an int to fix this. Detected by CoverityScan CID#1456886 ("Unsigned

[PATCH][drm-next] drm/i915/gvt: ensure -ve return value is handled correctly

2017-09-19 Thread Colin King
From: Colin Ian King An earlier fix changed the return type from find_bb_size however the integer return is being assigned to a unsigned int so the -ve error check will never be detected. Make bb_size an int to fix this. Detected by CoverityScan CID#1456886 ("Unsigned compared against 0")