[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20130119010351.903163884@linuxfoundation.org>
Date: Fri, 18 Jan 2013 17:16:42 -0800
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
alan@...rguk.ukuu.org.uk,
Ilija Hadzic <ihadzic@...earch.bell-labs.com>,
Alex Deucher <alexander.deucher@....com>,
Shuah Khan <shuah.khan@...com>, CAI Qian <caiqian@...hat.com>
Subject: [ 17/33] drm/radeon: fix a bogus kfree
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ilija Hadzic <ihadzic@...earch.bell-labs.com>
commit a6b7e1a02b77ab8fe8775d20a88c53d8ba55482e upstream.
parser->chunks[.].kpage[.] is not always kmalloc-ed
by the parser initialization, so parser_fini should
not try to kfree it if it didn't allocate it.
This patch fixes a kernel oops that can be provoked
in UMS mode.
Signed-off-by: Ilija Hadzic <ihadzic@...earch.bell-labs.com>
Signed-off-by: Alex Deucher <alexander.deucher@....com>
Signed-off-by: Shuah Khan <shuah.khan@...com>
Cc: CAI Qian <caiqian@...hat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/gpu/drm/radeon/r600_cs.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- a/drivers/gpu/drm/radeon/r600_cs.c
+++ b/drivers/gpu/drm/radeon/r600_cs.c
@@ -2429,8 +2429,10 @@ static void r600_cs_parser_fini(struct r
kfree(parser->relocs);
for (i = 0; i < parser->nchunks; i++) {
kfree(parser->chunks[i].kdata);
- kfree(parser->chunks[i].kpage[0]);
- kfree(parser->chunks[i].kpage[1]);
+ if (parser->rdev && (parser->rdev->flags & RADEON_IS_AGP)) {
+ kfree(parser->chunks[i].kpage[0]);
+ kfree(parser->chunks[i].kpage[1]);
+ }
}
kfree(parser->chunks);
kfree(parser->chunks_array);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists