Skip to content

Commit

Permalink
s390/dasd: fix memory leak caused by dangling references to request_q…
Browse files Browse the repository at this point in the history
…ueue

After the call to del_gendisk, the gendisk still holds a reference to
its request_queue. We must not modify the gendisks queue pointer
before the put_disk call, or the gendisk_release function cannot
release the reference and the memory for the request_queue structure
is lost.

Signed-off-by: Stefan Weinhuber <wein@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Stefan Weinhuber authored and Martin Schwidefsky committed Dec 2, 2013
1 parent af91706 commit b2b0154
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion drivers/s390/block/dasd_genhd.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ void dasd_gendisk_free(struct dasd_block *block)
{
if (block->gdp) {
del_gendisk(block->gdp);
block->gdp->queue = NULL;
block->gdp->private_data = NULL;
put_disk(block->gdp);
block->gdp = NULL;
Expand Down

0 comments on commit b2b0154

Please sign in to comment.