mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Alexander Y. Fomichev" <git.user@gmail.com>
To: Dave Airlie <airlied@redhat.com>,
	Alex Deucher <alexdeucher@gmail.com>,
	Robert Noland <rnoland@2hip.net>,
	Matt Turner <mattst88@gmail.com>,
	Jerome Glisse <jglisse@redhat.com>,
	akpm@linux-foundation.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: drivers/gpu/drm/radeon/r600_blit.c: fix possible NULL pointer derefernce
Date: Tue, 20 Jul 2010 01:42:51 +0400	[thread overview]
Message-ID: <20100720014251.46b91cdd@mad-cat.localdomain> (raw)

This patch fix possible NULL pointer dereference when
r600_prepare_blit_copy tries to fill dev_priv->blit_vb->file_priv
without check of dev_priv->blit_vb. dev_priv->blit_vb should be
filled by r600_nomm_get_vb but latest can fail with EAGAIN.
Addresses: https://bugzilla.kernel.org/show_bug.cgi?id=16375

---
 drivers/gpu/drm/radeon/r600_blit.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/radeon/r600_blit.c b/drivers/gpu/drm/radeon/r600_blit.c
index f4fb88e..0df4a2b 100644
--- a/drivers/gpu/drm/radeon/r600_blit.c
+++ b/drivers/gpu/drm/radeon/r600_blit.c
@@ -541,6 +541,8 @@ r600_prepare_blit_copy(struct drm_device *dev, struct drm_file *file_priv)
        DRM_DEBUG("\n");

        r600_nomm_get_vb(dev);
+       if (!dev_priv->blit_vb)
+               return;

        dev_priv->blit_vb->file_priv = file_priv;

--
1.7.1.1

             reply	other threads:[~2010-07-19 21:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-19 21:42 Alexander Y. Fomichev [this message]
2010-07-20 17:37 ` Alex Deucher
2010-07-20 20:13   ` Alexander Y. Fomichev
2010-07-20 21:00     ` Alex Deucher
2010-07-20 21:07       ` Alexander Y. Fomichev
2010-07-20 21:29         ` Alex Deucher
2010-07-21  7:06           ` Alexander Y. Fomichev
2010-07-21  0:30         ` Dave Airlie

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=20100720014251.46b91cdd@mad-cat.localdomain \
    --to=git.user@gmail.com \
    --cc=airlied@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=alexdeucher@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jglisse@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mattst88@gmail.com \
    --cc=rnoland@2hip.net \
    /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

all inboxes | Powered by JetHome®