From: Stefan Weinhuber Date: Fri, 29 Nov 2013 14:37:20 +0000 (+0100) Subject: s390/dasd: fix memory leak caused by dangling references to request_queue X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b2b0154e49e2b9470ae0d082128b5549cbe71152;p=linux-beck.git s390/dasd: fix memory leak caused by dangling references to request_queue 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 Signed-off-by: Martin Schwidefsky --- diff --git a/drivers/s390/block/dasd_genhd.c b/drivers/s390/block/dasd_genhd.c index f64921756ad6..f224d59c4b6b 100644 --- a/drivers/s390/block/dasd_genhd.c +++ b/drivers/s390/block/dasd_genhd.c @@ -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;