diff options
author | Borislav Petkov <petkovbb@googlemail.com> | 2008-04-09 10:21:39 +1000 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2008-04-09 10:21:39 +1000 |
commit | f3938b3e1edcc3d0d638a00474b21829f8fb804e (patch) | |
tree | d826cf3422079a4233708525371846d864eff45e | |
parent | e71c5cc6850e2aada04d49709a2ccf0a7aa5afeb (diff) |
ide-tape: fix mem leak
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>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r-- | 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 78a76a03e8e1..29870c415110 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; |