From: Rodrigo Vivi <rodrigo.vivi@intel.com> To: "Thomas Hellström" <thomas.hellstrom@linux.intel.com> Cc: Dan Carpenter <dan.carpenter@oracle.com>, Jani Nikula <jani.nikula@linux.intel.com>, Chris Wilson <chris@chris-wilson.co.uk>, Joonas Lahtinen <joonas.lahtinen@linux.intel.com>, David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>, Matthew Auld <matthew.auld@intel.com>, Jason Ekstrand <jason@jlekstrand.net>, Lucas De Marchi <lucas.demarchi@intel.com>, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH] drm/i915/gt: Potential error pointer dereference in pinned_context() Date: Fri, 20 Aug 2021 12:34:01 -0400 [thread overview] Message-ID: <YR/ZeRfyltL9ACSr@intel.com> (raw) In-Reply-To: <866cce10-f983-23d5-06db-b0effc11e50f@linux.intel.com> On Fri, Aug 13, 2021 at 04:01:06PM +0200, Thomas Hellström wrote: > > On 8/13/21 1:36 PM, Dan Carpenter wrote: > > If the intel_engine_create_pinned_context() function returns an error > > pointer, then dereferencing "ce" will Oops. Use "vm" instead of > > "ce->vm". > > > > Fixes: cf586021642d ("drm/i915/gt: Pipelined page migration") > > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> > > --- > > drivers/gpu/drm/i915/gt/intel_migrate.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/gpu/drm/i915/gt/intel_migrate.c b/drivers/gpu/drm/i915/gt/intel_migrate.c > > index d0a7c934fd3b..1dac21aa7e5c 100644 > > --- a/drivers/gpu/drm/i915/gt/intel_migrate.c > > +++ b/drivers/gpu/drm/i915/gt/intel_migrate.c > > @@ -177,7 +177,7 @@ static struct intel_context *pinned_context(struct intel_gt *gt) > > ce = intel_engine_create_pinned_context(engine, vm, SZ_512K, > > I915_GEM_HWS_MIGRATE, > > &key, "migrate"); > > - i915_vm_put(ce->vm); > > + i915_vm_put(vm); > > return ce; > > } > > Thanks, > > Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> And pushed to drm-intel-gt-next, thanks for the patch and review. > >
WARNING: multiple messages have this Message-ID (diff)
From: Rodrigo Vivi <rodrigo.vivi@intel.com> To: "Thomas Hellström" <thomas.hellstrom@linux.intel.com> Cc: Dan Carpenter <dan.carpenter@oracle.com>, Jani Nikula <jani.nikula@linux.intel.com>, Chris Wilson <chris@chris-wilson.co.uk>, Joonas Lahtinen <joonas.lahtinen@linux.intel.com>, David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>, Matthew Auld <matthew.auld@intel.com>, Jason Ekstrand <jason@jlekstrand.net>, Lucas De Marchi <lucas.demarchi@intel.com>, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, kernel-janitors@vger.kernel.org Subject: Re: [Intel-gfx] [PATCH] drm/i915/gt: Potential error pointer dereference in pinned_context() Date: Fri, 20 Aug 2021 12:34:01 -0400 [thread overview] Message-ID: <YR/ZeRfyltL9ACSr@intel.com> (raw) In-Reply-To: <866cce10-f983-23d5-06db-b0effc11e50f@linux.intel.com> On Fri, Aug 13, 2021 at 04:01:06PM +0200, Thomas Hellström wrote: > > On 8/13/21 1:36 PM, Dan Carpenter wrote: > > If the intel_engine_create_pinned_context() function returns an error > > pointer, then dereferencing "ce" will Oops. Use "vm" instead of > > "ce->vm". > > > > Fixes: cf586021642d ("drm/i915/gt: Pipelined page migration") > > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> > > --- > > drivers/gpu/drm/i915/gt/intel_migrate.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/gpu/drm/i915/gt/intel_migrate.c b/drivers/gpu/drm/i915/gt/intel_migrate.c > > index d0a7c934fd3b..1dac21aa7e5c 100644 > > --- a/drivers/gpu/drm/i915/gt/intel_migrate.c > > +++ b/drivers/gpu/drm/i915/gt/intel_migrate.c > > @@ -177,7 +177,7 @@ static struct intel_context *pinned_context(struct intel_gt *gt) > > ce = intel_engine_create_pinned_context(engine, vm, SZ_512K, > > I915_GEM_HWS_MIGRATE, > > &key, "migrate"); > > - i915_vm_put(ce->vm); > > + i915_vm_put(vm); > > return ce; > > } > > Thanks, > > Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> And pushed to drm-intel-gt-next, thanks for the patch and review. > >
next prev parent reply other threads:[~2021-08-20 16:34 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-08-13 11:36 [PATCH] drm/i915/gt: Potential error pointer dereference in pinned_context() Dan Carpenter 2021-08-13 11:36 ` [Intel-gfx] " Dan Carpenter 2021-08-13 12:35 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork 2021-08-13 14:01 ` [PATCH] " Thomas Hellström 2021-08-13 14:01 ` [Intel-gfx] " Thomas Hellström 2021-08-20 16:34 ` Rodrigo Vivi [this message] 2021-08-20 16:34 ` Rodrigo Vivi 2021-08-13 16:01 ` [Intel-gfx] ✗ Fi.CI.IGT: failure for " Patchwork 2021-08-18 18:31 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/gt: Potential error pointer dereference in pinned_context() (rev2) Patchwork 2021-08-18 20:12 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
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=YR/ZeRfyltL9ACSr@intel.com \ --to=rodrigo.vivi@intel.com \ --cc=airlied@linux.ie \ --cc=chris@chris-wilson.co.uk \ --cc=dan.carpenter@oracle.com \ --cc=daniel@ffwll.ch \ --cc=dri-devel@lists.freedesktop.org \ --cc=intel-gfx@lists.freedesktop.org \ --cc=jani.nikula@linux.intel.com \ --cc=jason@jlekstrand.net \ --cc=joonas.lahtinen@linux.intel.com \ --cc=kernel-janitors@vger.kernel.org \ --cc=lucas.demarchi@intel.com \ --cc=matthew.auld@intel.com \ --cc=thomas.hellstrom@linux.intel.com \ /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: linkBe 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.