Showing error 1579

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/scsi/gdth.c
Line in file: 4127
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2012-05-29 20:11:37 UTC


Source:

4097
4098static int ioc_lockdrv(void __user *arg)
4099{
4100    gdth_ioctl_lockdrv ldrv;
4101    unchar i, j;
4102    ulong flags;
4103    gdth_ha_str *ha;
4104
4105    if (copy_from_user(&ldrv, arg, sizeof(gdth_ioctl_lockdrv)))
4106        return -EFAULT;
4107    ha = gdth_find_ha(ldrv.ionode);
4108    if (!ha)
4109        return -EFAULT;
4110
4111    for (i = 0; i < ldrv.drive_cnt && i < MAX_HDRIVES; ++i) {
4112        j = ldrv.drives[i];
4113        if (j >= MAX_HDRIVES || !ha->hdr[j].present)
4114            continue;
4115        if (ldrv.lock) {
4116            spin_lock_irqsave(&ha->smp_lock, flags);
4117            ha->hdr[j].lock = 1;
4118            spin_unlock_irqrestore(&ha->smp_lock, flags);
4119            gdth_wait_completion(ha, ha->bus_cnt, j);
4120        } else {
4121            spin_lock_irqsave(&ha->smp_lock, flags);
4122            ha->hdr[j].lock = 0;
4123            spin_unlock_irqrestore(&ha->smp_lock, flags);
4124            gdth_next(ha);
4125        }
4126    } 
4127    return 0;
4128}
4129
4130static int ioc_resetdrv(void __user *arg, char *cmnd)
4131{
4132    gdth_ioctl_reset res;
4133    gdth_cmd_str cmd;
4134    gdth_ha_str *ha;
4135    int rval;
4136
4137    if (copy_from_user(&res, arg, sizeof(gdth_ioctl_reset)) ||
Show full sources