Showing error 1083

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/ata/libata-scsi.c
Line in file: 3049
Project: Linux Kernel
Project version: 2.6.28
Tools: Undetermined 1
Entered: 2012-03-04 17:07:06 UTC


Source:

3019 *
3020 *        RETURNS:
3021 *        Return value from __ata_scsi_queuecmd() if @cmd can be queued,
3022 *        0 otherwise.
3023 */
3024int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
3025{
3026        struct ata_port *ap;
3027        struct ata_device *dev;
3028        struct scsi_device *scsidev = cmd->device;
3029        struct Scsi_Host *shost = scsidev->host;
3030        int rc = 0;
3031
3032        ap = ata_shost_to_port(shost);
3033
3034        spin_unlock(shost->host_lock);
3035        spin_lock(ap->lock);
3036
3037        ata_scsi_dump_cdb(ap, cmd);
3038
3039        dev = ata_scsi_find_dev(ap, scsidev);
3040        if (likely(dev))
3041                rc = __ata_scsi_queuecmd(cmd, done, dev);
3042        else {
3043                cmd->result = (DID_BAD_TARGET << 16);
3044                done(cmd);
3045        }
3046
3047        spin_unlock(ap->lock);
3048        spin_lock(shost->host_lock);
3049        return rc;
3050}
3051
3052/**
3053 *        ata_scsi_simulate - simulate SCSI command on ATA device
3054 *        @dev: the target device
3055 *        @cmd: SCSI command being sent to device.
3056 *        @done: SCSI command completion function.
3057 *
3058 *        Interprets and directly executes a select list of SCSI commands
3059 *        that can be handled internally.
Show full sources