Patch "paride/pcd: cleanup queues when detection fails" has been added to the 5.0-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    paride/pcd: cleanup queues when detection fails

to the 5.0-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     paride-pcd-cleanup-queues-when-detection-fails.patch
and it can be found in the queue-5.0 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 39c0b55b26850c9b55f1985d75618f47a5343646
Author: Jens Axboe <axboe@xxxxxxxxx>
Date:   Mon Mar 18 08:10:32 2019 -0600

    paride/pcd: cleanup queues when detection fails
    
    [ Upstream commit 81b74ac68c28fddb3589ad5d4d5e587baf4bb781 ]
    
    The driver allocates queues for all the units it potentially
    supports. But if we fail to detect any drives, then we fail
    loading the module without cleaning up those queues. This is
    now evident with the switch to blk-mq, though the bug has
    been there forever as far as I can tell.
    
    Also fix cleanup through regular module exit.
    
    Reported-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
    Tested-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
    Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/block/paride/pcd.c b/drivers/block/paride/pcd.c
index 96670eefaeb2..377a694dc228 100644
--- a/drivers/block/paride/pcd.c
+++ b/drivers/block/paride/pcd.c
@@ -749,8 +749,12 @@ static int pcd_detect(void)
 		return 0;
 
 	printk("%s: No CD-ROM drive found\n", name);
-	for (unit = 0, cd = pcd; unit < PCD_UNITS; unit++, cd++)
+	for (unit = 0, cd = pcd; unit < PCD_UNITS; unit++, cd++) {
+		blk_cleanup_queue(cd->disk->queue);
+		cd->disk->queue = NULL;
+		blk_mq_free_tag_set(&cd->tag_set);
 		put_disk(cd->disk);
+	}
 	pi_unregister_driver(par_drv);
 	return -1;
 }



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux