From 53926274f24e5c852dbe8f89dea16b7822549472 Mon Sep 17 00:00:00 2001 From: Mark Haverkamp Date: Mon, 27 Mar 2006 09:44:19 -0800 Subject: [PATCH] [SCSI] aacraid: Fix extra unregister_chrdev Received from Mark Salyzyn If there are no aacraid controllers, we do not create the raid controller chrdev, thus when the driver is unloaded it performs a superfluous deregistration. Signed-off-by: Mark Haverkamp Signed-off-by: James Bottomley --- drivers/scsi/aacraid/linit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c index fbd4f5538a..9437a4c8b6 100644 --- a/drivers/scsi/aacraid/linit.c +++ b/drivers/scsi/aacraid/linit.c @@ -1023,7 +1023,8 @@ static int __init aac_init(void) static void __exit aac_exit(void) { - unregister_chrdev(aac_cfg_major, "aac"); + if (aac_cfg_major > -1) + unregister_chrdev(aac_cfg_major, "aac"); pci_unregister_driver(&aac_pci_driver); } -- 2.39.5