Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756138AbcJTACi (ORCPT ); Wed, 19 Oct 2016 20:02:38 -0400 Received: from mga01.intel.com ([192.55.52.88]:29933 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756100AbcJTACh (ORCPT ); Wed, 19 Oct 2016 20:02:37 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,516,1473145200"; d="asc'?scan'208";a="21517330" Date: Thu, 20 Oct 2016 07:58:16 +0800 From: Zhenyu Wang To: Wei Yongjun Cc: Daniel Vetter , Jani Nikula , David Airlie , Yulei Zhang , Zhenyu Wang , Zhi Wang , Wei Yongjun , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH -next] drm/i915/gvt: fix return value check Message-ID: <20161019235816.qojvm3vtp4cc76w7@zhen-hp.sh.intel.com> Reply-To: Zhenyu Wang References: <1476893883-8096-1-git-send-email-weiyj.lk@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="22phbspfgzdcsdds" Content-Disposition: inline In-Reply-To: <1476893883-8096-1-git-send-email-weiyj.lk@gmail.com> User-Agent: NeoMutt/20160910 (1.7.0) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2146 Lines: 73 --22phbspfgzdcsdds Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2016.10.19 16:18:03 +0000, Wei Yongjun wrote: > From: Wei Yongjun >=20 > 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(). >=20 > Signed-off-by: Wei Yongjun Hi, Yongjun, we've already had this fixed in our queue for next pull reques= t, will send very soon. Thanks. > --- > drivers/gpu/drm/i915/gvt/cmd_parser.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) >=20 > 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_sta= te *s) > =20 > entry_obj->obj =3D i915_gem_object_create(&(s->vgpu->gvt->dev_priv->drm= ), > round_up(bb_size, PAGE_SIZE)); > - if (entry_obj->obj =3D=3D NULL) > - return -ENOMEM; > + if (IS_ERR(entry_obj->obj)) > + return PTR_ERR(entry_obj->obj); > entry_obj->len =3D bb_size; > INIT_LIST_HEAD(&entry_obj->list); > =20 > @@ -2712,8 +2712,8 @@ static int shadow_indirect_ctx(struct intel_shadow_= wa_ctx *wa_ctx) > =20 > wa_ctx->indirect_ctx.obj =3D i915_gem_object_create(dev, > round_up(ctx_size + CACHELINE_BYTES, PAGE_SIZE)); > - if (wa_ctx->indirect_ctx.obj =3D=3D NULL) > - return -ENOMEM; > + if (IS_ERR(wa_ctx->indirect_ctx.obj)) > + return PTR_ERR(wa_ctx->indirect_ctx.obj); > =20 > ret =3D i915_gem_object_get_pages(wa_ctx->indirect_ctx.obj); > if (ret) >=20 --=20 Open Source Technology Center, Intel ltd. $gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827 --22phbspfgzdcsdds Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iEYEABECAAYFAlgICJMACgkQsQQaM014GCeYpACeJ/QiFnniDRXGx5hvNyOlolXc KDAAoIRDiKa31U/GZ91P0Xe4TZrNU3eC =1V8m -----END PGP SIGNATURE----- --22phbspfgzdcsdds--