lkml.org 
[lkml]   [2008]   [Apr]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 6/6] ide-tape: fix mem leak
Date
From
On failed struct idetape_bh allocation the logic frees only one buffer page
which was the old page-wise strategy. Doing that now would probably leak
2^order-1 pages so fix it to free all and not only the first buffer page.

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
---
drivers/ide/ide-tape.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 78a76a0..29870c4 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -1348,7 +1348,7 @@ static struct idetape_bh *ide_tape_kmalloc_buffer(idetape_tape_t *tape,
prev_bh = bh;
bh = kmalloc(sizeof(struct idetape_bh), GFP_KERNEL);
if (!bh) {
- free_page((unsigned long) b_data);
+ free_pages((unsigned long) b_data, order);
goto abort;
}
bh->b_reqnext = NULL;
--
1.5.4.1


\
 
 \ /
  Last update: 2008-04-07 06:49    [W:0.044 / U:2.612 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site