unmap_cmd_data(&found_evt->iu.srp.cmd, found_evt->hostdata->dev); 
unmap_cmd_data(&found_evt->iu.srp.cmd, found_evt, found_evt->hostdata->dev); 
static int ibmvscsi_eh_abort_handler(struct scsi_cmnd *cmd){	struct ibmvscsi_host_data *hostdata =	    (struct ibmvscsi_host_data *)cmd->device->host->hostdata;	struct srp_tsk_mgmt *tsk_mgmt;	struct srp_event_struct *evt;	struct srp_event_struct *tmp_evt, *found_evt;	union viosrp_iu srp_rsp;	int rsp_rc;	unsigned long flags;	u16 lun = lun_from_dev(cmd->device);	/* First, find this command in our sent list so we can figure	 * out the correct tag	 */	spin_lock_irqsave(hostdata->host->host_lock, flags);	found_evt = NULL;	list_for_each_entry(tmp_evt, &hostdata->sent, list) {		if (tmp_evt->cmnd == cmd) {			found_evt = tmp_evt;			break;		}	}	if (!found_evt) {		spin_unlock_irqrestore(hostdata->host->host_lock, flags);		return FAILED;	}	evt = get_event_struct(&hostdata->pool);	if (evt == NULL) {		spin_unlock_irqrestore(hostdata->host->host_lock, flags);		printk(KERN_ERR "ibmvscsi: failed to allocate abort event\n");		return FAILED;	}		init_event_struct(evt,			  sync_completion,			  VIOSRP_SRP_FORMAT,			  init_timeout * HZ);	tsk_mgmt = &evt->iu.srp.tsk_mgmt;		/* Set up an abort SRP command */	memset(tsk_mgmt, 0x00, sizeof(*tsk_mgmt));	tsk_mgmt->type = SRP_TSK_MGMT_TYPE;	tsk_mgmt->lun = ((u64) lun) << 48;	tsk_mgmt->task_mgmt_flags = 0x01;	/* ABORT TASK */	tsk_mgmt->managed_task_tag = (u64) found_evt;	printk(KERN_INFO "ibmvscsi: aborting command. lun 0x%lx, tag 0x%lx\n",	       tsk_mgmt->lun, tsk_mgmt->managed_task_tag);	evt->sync_srp = &srp_rsp;	init_completion(&evt->comp);	rsp_rc = ibmvscsi_send_srp_event(evt, hostdata);	spin_unlock_irqrestore(hostdata->host->host_lock, flags);	if (rsp_rc != 0) {		printk(KERN_ERR "ibmvscsi: failed to send abort() event\n");		return FAILED;	}	wait_for_completion(&evt->comp);	/* make sure we got a good response */	if (unlikely(srp_rsp.srp.generic.type != SRP_RSP_TYPE)) {		if (printk_ratelimit())			printk(KERN_WARNING 			       "ibmvscsi: abort bad SRP RSP type %d\n",			       srp_rsp.srp.generic.type);		return FAILED;	}	if (srp_rsp.srp.rsp.rspvalid)		rsp_rc = *((int *)srp_rsp.srp.rsp.sense_and_response_data);	else		rsp_rc = srp_rsp.srp.rsp.status;	if (rsp_rc) {		if (printk_ratelimit())			printk(KERN_WARNING 		       "ibmvscsi: abort code %d for task tag 0x%lx\n",			       rsp_rc,			       tsk_mgmt->managed_task_tag);		return FAILED;	}	/* Because we dropped the spinlock above, it's possible	 * The event is no longer in our list.  Make sure it didn't	 * complete while we were aborting	 */	spin_lock_irqsave(hostdata->host->host_lock, flags);	found_evt = NULL;	list_for_each_entry(tmp_evt, &hostdata->sent, list) {		if (tmp_evt->cmnd == cmd) {			found_evt = tmp_evt;			break;		}	}	if (found_evt == NULL) {		spin_unlock_irqrestore(hostdata->host->host_lock, flags);		printk(KERN_INFO		       "ibmvscsi: aborted task tag 0x%lx completed\n",		       tsk_mgmt->managed_task_tag);		return SUCCESS;	}	printk(KERN_INFO	       "ibmvscsi: successfully aborted task tag 0x%lx\n",	       tsk_mgmt->managed_task_tag);	cmd->result = (DID_ABORT << 16);	list_del(&found_evt->list);	unmap_cmd_data(&found_evt->iu.srp.cmd, found_evt->hostdata->dev);	free_event_struct(&found_evt->hostdata->pool, found_evt);	spin_unlock_irqrestore(hostdata->host->host_lock, flags);	atomic_inc(&hostdata->request_limit);	return SUCCESS;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/4dddbc26c3895ecdab1f4b16435685b47f96f599/ibmvscsi.c/buggy/drivers/scsi/ibmvscsi/ibmvscsi.c