public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: [bug report] drm/i915: Small compaction of the engine init code
Date: Thu, 15 Dec 2016 23:44:13 +0300	[thread overview]
Message-ID: <20161215204413.GA24117@elgon.mountain> (raw)

Hello Tvrtko Ursulin,

The patch a19d6ff29a82: "drm/i915: Small compaction of the engine
init code" from Jun 23, 2016, leads to the following static checker
warning:

	drivers/gpu/drm/i915/intel_lrc.c:1973 logical_render_ring_init()
	warn: passing freed memory 'engine'

drivers/gpu/drm/i915/intel_lrc.c
  1970  
  1971          ret = logical_ring_init(engine);
  1972          if (ret) {
  1973                  lrc_destroy_wa_ctx_obj(engine);

The problem is that logical_ring_init() frees "engine" on the error
path so this is a use after free.

  1974          }
  1975  
  1976          return ret;
  1977  }

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

             reply	other threads:[~2016-12-15 20:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-15 20:44 Dan Carpenter [this message]
2016-12-15 20:54 ` [bug report] drm/i915: Small compaction of the engine init code Chris Wilson
2016-12-16  8:02   ` [Intel-gfx] " Tvrtko Ursulin
2016-12-16  8:38     ` Tvrtko Ursulin

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=20161215204413.GA24117@elgon.mountain \
    --to=dan.carpenter@oracle.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=tvrtko.ursulin@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox