]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[SCSI] aic94xx: Match request_firmware with release_firmware
authorDarrick J. Wong <djwong@us.ibm.com>
Thu, 11 Jan 2007 22:15:26 +0000 (14:15 -0800)
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>
Sat, 13 Jan 2007 22:19:07 +0000 (16:19 -0600)
The vmalloc() blob holding the sequencer firmware wasn't being released at
module unload time, which resulted in a memory leak.

Signed-off-by: Alexis Bruemmer <alexisb@us.ibm.com>
Acked-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/scsi/aic94xx/aic94xx_init.c
drivers/scsi/aic94xx/aic94xx_seq.c
drivers/scsi/aic94xx/aic94xx_seq.h

index 9a9ea74c8d9ea4c41ed3f86db23a2205b449e048..6faa10f59c1863981e0fa98f7773d521458c198e 100644 (file)
@@ -886,6 +886,7 @@ static void __exit aic94xx_exit(void)
        asd_remove_driver_attrs(&aic94xx_pci_driver.driver);
        pci_unregister_driver(&aic94xx_pci_driver);
        sas_release_transport(aic94xx_transport_template);
+       asd_release_firmware();
        asd_destroy_global_caches();
        asd_printk("%s version %s unloaded\n", ASD_DRIVER_DESCRIPTION,
                   ASD_DRIVER_VERSION);
index 845112539d05bd02617e3abae81e83a80ab75a35..21569ecd8ec8213eb83296e1fd4dbd8c971e3617 100644 (file)
@@ -1232,6 +1232,13 @@ static int asd_seq_start_lseq(struct asd_ha_struct *asd_ha, int lseq)
        return asd_seq_unpause_lseq(asd_ha, lseq);
 }
 
+int asd_release_firmware(void)
+{
+       if (sequencer_fw)
+               release_firmware(sequencer_fw);
+       return 0;
+}
+
 static int asd_request_firmware(struct asd_ha_struct *asd_ha)
 {
        int err, i;
index 9e715e5496af93b4a585b9764a645d7dcbd2db86..9437ff0ae3a4f6ce9852c8c08a2b48588db3ea2b 100644 (file)
@@ -63,6 +63,7 @@ int asd_pause_lseq(struct asd_ha_struct *asd_ha, u8 lseq_mask);
 int asd_unpause_lseq(struct asd_ha_struct *asd_ha, u8 lseq_mask);
 int asd_init_seqs(struct asd_ha_struct *asd_ha);
 int asd_start_seqs(struct asd_ha_struct *asd_ha);
+int asd_release_firmware(void);
 
 void asd_update_port_links(struct asd_ha_struct *asd_ha, struct asd_phy *phy);
 #endif