From: Mark Haverkamp Date: Mon, 27 Mar 2006 17:44:19 +0000 (-0800) Subject: [SCSI] aacraid: Fix extra unregister_chrdev X-Git-Tag: v2.6.17-rc2~30^2~35 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=53926274f24e5c852dbe8f89dea16b7822549472;p=linux-2.6 [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 --- 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); }