From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Zhenyu Wang <zhenyuw@linux.intel.com>, Zhi Wang <zhi.a.wang@intel.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915/kvmgt: avoid dereferencing a potentially null info pointer
Date: Thu, 23 Mar 2017 16:11:00 +0200 [thread overview]
Message-ID: <1490278260.16902.12.camel@linux.intel.com> (raw)
In-Reply-To: <20170323123900.GL27773@nuc-i3427.alporthouse.com>
Dropping the irrelevant Cc's.
On to, 2017-03-23 at 12:39 +0000, Chris Wilson wrote:
> On Thu, Mar 23, 2017 at 12:22:30PM +0000, Colin King wrote:
> >
> > From: Colin Ian King <colin.king@canonical.com>
> >
> > info is being checked to see if it is a null pointer, however, vpgu is
> > dereferencing info before this check, leading to a potential null
> > pointer dereference. If info is null, then the error message being
> > printed by macro gvt_vgpu_err and this requires vpgu to exist. We can
> > use a null vpgu as the macro has a sanity check to see if vpgu is null,
> > so this is OK.
>
> It is never NULL, it gets checked by its only caller.
Took me a while to make any sense of the code as gvt_vgpu_err depends
on a vgpu variable being declared in the scope without taking it as a
parameter and that is a one big no-no:
https://01.org/linuxgraphics/gfx-docs/drm/process/coding-style.html#macros-enums-and-rtl
Regards, Joonas
--
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-03-23 14:11 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-23 12:22 [PATCH] drm/i915/kvmgt: avoid dereferencing a potentially null info pointer Colin King
2017-03-23 12:22 ` Colin King
2017-03-23 12:39 ` Chris Wilson
2017-03-23 12:39 ` Chris Wilson
2017-03-23 12:39 ` Chris Wilson
2017-03-23 14:11 ` Joonas Lahtinen [this message]
2017-03-24 3:06 ` Zhenyu Wang
2017-03-23 13:16 ` ✗ Fi.CI.BAT: warning for " Patchwork
2017-03-23 13:43 ` [PATCH] " Frans Klaver
2017-03-23 13:43 ` Frans Klaver
2017-03-24 3:38 ` Zhenyu Wang
2017-03-24 3:38 ` Zhenyu Wang
2017-03-24 3:38 ` Zhenyu Wang
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=1490278260.16902.12.camel@linux.intel.com \
--to=joonas.lahtinen@linux.intel.com \
--cc=daniel.vetter@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=zhenyuw@linux.intel.com \
--cc=zhi.a.wang@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.