All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michal Wajdeczko" <michal.wajdeczko@intel.com>
To: intel-gfx@lists.freedesktop.org,
	"Piotr Piórkowski" <piotr.piorkowski@intel.com>
Subject: Re: [PATCH v2] drm/i915/guc: Fix null pointer dereference when GuC FW is not available
Date: Thu, 22 Mar 2018 18:15:22 +0100	[thread overview]
Message-ID: <op.zgafjwpvxaggs7@mwajdecz-mobl1.ger.corp.intel.com> (raw)
In-Reply-To: <20180322170551.26342-1-piotr.piorkowski@intel.com>

On Thu, 22 Mar 2018 18:05:51 +0100, Piotr Piórkowski  
<piotr.piorkowski@intel.com> wrote:

> If GuC firmware is not available on the system and we load i915 with  
> enable
> GuC, then we hit this null pointer dereference issue:
>

/snip/

> diff --git a/drivers/gpu/drm/i915/intel_uc_fw.c  
> b/drivers/gpu/drm/i915/intel_uc_fw.c
> index 30c73243f54d..c0663857cd43 100644
> --- a/drivers/gpu/drm/i915/intel_uc_fw.c
> +++ b/drivers/gpu/drm/i915/intel_uc_fw.c
> @@ -199,7 +199,6 @@ int intel_uc_fw_upload(struct intel_uc_fw *uc_fw,
>  		       int (*xfer)(struct intel_uc_fw *uc_fw,
>  				   struct i915_vma *vma))
>  {
> -	struct drm_i915_private *i915 = to_i915(uc_fw->obj->base.dev);
>  	struct i915_vma *vma;
>  	int err;
> @@ -224,7 +223,7 @@ int intel_uc_fw_upload(struct intel_uc_fw *uc_fw,
> 	vma = i915_gem_object_ggtt_pin(uc_fw->obj, NULL, 0, 0,
>  				       PIN_OFFSET_BIAS |
> -				       i915->guc.ggtt_pin_bias);
> +				       to_i915(uc_fw->obj->base.dev)->guc.ggtt_pin_bias);

hmm, sorry, but it looks too ugly and also is over 80

so let's just initialize i915 after checking fetch_status as was suggested
by Jackie (but maybe without GEM_BUG_ON)

/m

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-03-22 17:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-22 16:18 [PATCH] drm/i915/guc: Fix null pointer dereference when GuC FW is not available Piotr Piórkowski
2018-03-22 16:25 ` Michal Wajdeczko
2018-03-22 16:50 ` Yaodong Li
2018-03-22 17:05 ` [PATCH v2] " Piotr Piórkowski
2018-03-22 17:15   ` Michal Wajdeczko [this message]
2018-03-22 18:17   ` [PATCH v3] " Piotr Piórkowski
2018-03-22 18:21     ` Michal Wajdeczko
2018-03-23  8:49       ` Joonas Lahtinen
2018-03-23 10:09         ` Michal Wajdeczko
2018-03-22 22:06     ` Yaodong Li
2018-03-22 17:34 ` ✗ Fi.CI.BAT: failure for drm/i915/guc: Fix null pointer dereference when GuC FW is not available (rev2) Patchwork
2018-03-22 18:36 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/guc: Fix null pointer dereference when GuC FW is not available (rev3) Patchwork
2018-03-22 18:51 ` ✓ Fi.CI.BAT: success " Patchwork
2018-03-22 20:37 ` ✓ 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=op.zgafjwpvxaggs7@mwajdecz-mobl1.ger.corp.intel.com \
    --to=michal.wajdeczko@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=piotr.piorkowski@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: link
Be 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.