Showing error 1049

User: Jiri Slaby
Error type: Leaving function in locked state
Error type description: Some lock is not unlocked on all paths of a function, so it is leaked
File location: drivers/ide/ide.c
Line in file: 148
Project: Linux Kernel
Project version: 2.6.28
Tools: Undetermined 1
Entered: 2012-03-04 17:07:06 UTC


Source:

118                drive->hwif                        = hwif;
119                drive->ready_stat                = ATA_DRDY;
120                drive->bad_wstat                = BAD_W_STAT;
121                drive->special.b.recalibrate        = 1;
122                drive->special.b.set_geometry        = 1;
123                drive->name[0]                        = 'h';
124                drive->name[1]                        = 'd';
125                drive->name[2]                        = 'a' + j;
126                drive->max_failures                = IDE_DEFAULT_MAX_FAILURES;
127
128                INIT_LIST_HEAD(&drive->list);
129                init_completion(&drive->gendev_rel_comp);
130        }
131}
132
133/* Called with ide_lock held. */
134static void __ide_port_unregister_devices(ide_hwif_t *hwif)
135{
136        int i;
137
138        for (i = 0; i < MAX_DRIVES; i++) {
139                ide_drive_t *drive = &hwif->drives[i];
140
141                if (drive->dev_flags & IDE_DFLAG_PRESENT) {
142                        spin_unlock_irq(&ide_lock);
143                        device_unregister(&drive->gendev);
144                        wait_for_completion(&drive->gendev_rel_comp);
145                        spin_lock_irq(&ide_lock);
146                }
147        }
148}
149
150void ide_port_unregister_devices(ide_hwif_t *hwif)
151{
152        mutex_lock(&ide_cfg_mtx);
153        spin_lock_irq(&ide_lock);
154        __ide_port_unregister_devices(hwif);
155        hwif->present = 0;
156        ide_port_init_devices_data(hwif);
157        spin_unlock_irq(&ide_lock);
158        mutex_unlock(&ide_cfg_mtx);
Show full sources