Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752604AbbEKWsG (ORCPT ); Mon, 11 May 2015 18:48:06 -0400 Received: from mailout.micron.com ([137.201.242.129]:18963 "EHLO mailout.micron.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751245AbbEKWsD (ORCPT ); Mon, 11 May 2015 18:48:03 -0400 From: Asai Thambi SP Subject: [PATCH 1/9] mtip32xx: fix rmmod issue To: Jens Axboe CC: , Sam Bradshaw , Selvan Mani Message-ID: <555131A0.5080606@micron.com> Date: Mon, 11 May 2015 15:48:00 -0700 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-TM-AS-Product-Ver: SMEX-11.0.0.4179-7.500.1018-21536.005 X-TM-AS-Result: No--5.773900-0.000000-31 X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-MT-CheckInternalSenderRule: True Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1761 Lines: 62 put_disk() need to be called after del_gendisk() to free the disk object structure. Signed-off-by: Selvan Mani Signed-off-by: Asai Thambi S P --- drivers/block/mtip32xx/mtip32xx.c | 13 +++++++------ 1 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c index 3bd7ca9..b79b59a 100644 --- a/drivers/block/mtip32xx/mtip32xx.c +++ b/drivers/block/mtip32xx/mtip32xx.c @@ -2809,6 +2809,7 @@ static int mtip_free_orphan(struct driver_data *dd) kobject_put(kobj); } del_gendisk(dd->disk); + put_disk(dd->disk); dd->disk = NULL; } if (dd->queue) { @@ -4095,13 +4096,13 @@ static int mtip_block_remove(struct driver_data *dd) dd->bdev = NULL; } if (dd->disk) { + del_gendisk(dd->disk); if (dd->disk->queue) { - del_gendisk(dd->disk); blk_cleanup_queue(dd->queue); blk_mq_free_tag_set(&dd->tags); dd->queue = NULL; - } else - put_disk(dd->disk); + } + put_disk(dd->disk); } dd->disk = NULL; @@ -4140,12 +4141,12 @@ static int mtip_block_shutdown(struct driver_data *dd) dev_info(&dd->pdev->dev, "Shutting down %s ...\n", dd->disk->disk_name); + del_gendisk(dd->disk); if (dd->disk->queue) { - del_gendisk(dd->disk); blk_cleanup_queue(dd->queue); blk_mq_free_tag_set(&dd->tags); - } else - put_disk(dd->disk); + } + put_disk(dd->disk); dd->disk = NULL; dd->queue = NULL; } -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/