dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Ilija Hadzic <ihadzic@research.bell-labs.com>
To: dri-devel@lists.freedesktop.org
Subject: [PATCH 3/3] drm/radeon: fix error path in kpage allocation
Date: Mon,  7 Jan 2013 18:21:59 -0500	[thread overview]
Message-ID: <1357600919-9967-4-git-send-email-ihadzic@research.bell-labs.com> (raw)
In-Reply-To: <1357600919-9967-1-git-send-email-ihadzic@research.bell-labs.com>

Index into chunks[] array doesn't look right.

Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
---
 drivers/gpu/drm/radeon/radeon_cs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c
index 45151c4..469661f 100644
--- a/drivers/gpu/drm/radeon/radeon_cs.c
+++ b/drivers/gpu/drm/radeon/radeon_cs.c
@@ -284,8 +284,8 @@ int radeon_cs_parser_init(struct radeon_cs_parser *p, void *data)
 			p->chunks[p->chunk_ib_idx].kpage[1] = kmalloc(PAGE_SIZE, GFP_KERNEL);
 			if (p->chunks[p->chunk_ib_idx].kpage[0] == NULL ||
 			    p->chunks[p->chunk_ib_idx].kpage[1] == NULL) {
-				kfree(p->chunks[i].kpage[0]);
-				kfree(p->chunks[i].kpage[1]);
+				kfree(p->chunks[p->chunk_ib_idx].kpage[0]);
+				kfree(p->chunks[p->chunk_ib_idx].kpage[1]);
 				return -ENOMEM;
 			}
 		}
-- 
1.8.1

  parent reply	other threads:[~2013-01-07 23:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-07 23:21 fix for crashes provoked by UMS mode Ilija Hadzic
2013-01-07 23:21 ` [PATCH 1/3] drm/radeon: fix NULL pointer dereference in " Ilija Hadzic
2013-01-07 23:21 ` [PATCH 2/3] drm/radeon: fix a bogus kfree Ilija Hadzic
2013-01-07 23:21 ` Ilija Hadzic [this message]
2013-01-08 13:56 ` fix for crashes provoked by UMS mode Alex Deucher

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=1357600919-9967-4-git-send-email-ihadzic@research.bell-labs.com \
    --to=ihadzic@research.bell-labs.com \
    --cc=dri-devel@lists.freedesktop.org \
    /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;
as well as URLs for NNTP newsgroup(s).