Merge branch 'master'

This commit is contained in:
Jeff Garzik 2005-11-09 01:07:12 -05:00
commit a892acacd3
1533 changed files with 51549 additions and 23711 deletions

View file

@ -1017,8 +1017,7 @@ static void twa_free_device_extension(TW_Device_Extension *tw_dev)
tw_dev->generic_buffer_virt[0],
tw_dev->generic_buffer_phys[0]);
if (tw_dev->event_queue[0])
kfree(tw_dev->event_queue[0]);
kfree(tw_dev->event_queue[0]);
} /* End twa_free_device_extension() */
/* This function will free a request id */

View file

@ -606,10 +606,7 @@ static int __init NCR5380_probe_irq(struct Scsi_Host *instance, int possible)
NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_DATA | ICR_ASSERT_SEL);
while (probe_irq == SCSI_IRQ_NONE && time_before(jiffies, timeout))
{
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(1);
}
schedule_timeout_uninterruptible(1);
NCR5380_write(SELECT_ENABLE_REG, 0);
NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);

View file

@ -1164,7 +1164,7 @@ int aac_command_thread(struct aac_dev * dev)
kfree(hw_fib_pool);
hw_fib_pool = NULL;
}
} else if (hw_fib_pool) {
} else {
kfree(hw_fib_pool);
hw_fib_pool = NULL;
}
@ -1247,17 +1247,13 @@ int aac_command_thread(struct aac_dev * dev)
hw_fib_p = hw_fib_pool;
fib_p = fib_pool;
while (hw_fib_p < &hw_fib_pool[num]) {
if (*hw_fib_p)
kfree(*hw_fib_p);
if (*fib_p)
kfree(*fib_p);
kfree(*hw_fib_p);
kfree(*fib_p);
++fib_p;
++hw_fib_p;
}
if (hw_fib_pool)
kfree(hw_fib_pool);
if (fib_pool)
kfree(fib_pool);
kfree(hw_fib_pool);
kfree(fib_pool);
}
kfree(fib);
spin_lock_irqsave(dev->queues->queue[HostNormCmdQueue].lock, flags);

View file

@ -183,8 +183,7 @@ static int rkt_sync_cmd(struct aac_dev *dev, u32 command,
/*
* Yield the processor in case we are slow
*/
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(1);
schedule_timeout_uninterruptible(1);
}
if (ok != 1) {
/*
@ -452,8 +451,7 @@ int aac_rkt_init(struct aac_dev *dev)
dev->name, instance, status);
goto error_iounmap;
}
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(1);
schedule_timeout_uninterruptible(1);
}
if (request_irq(dev->scsi_host_ptr->irq, aac_rkt_intr, SA_SHIRQ|SA_INTERRUPT, "aacraid", (void *)dev)<0)
{

View file

@ -183,8 +183,7 @@ static int rx_sync_cmd(struct aac_dev *dev, u32 command,
/*
* Yield the processor in case we are slow
*/
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(1);
schedule_timeout_uninterruptible(1);
}
if (ok != 1) {
/*
@ -452,8 +451,7 @@ int aac_rx_init(struct aac_dev *dev)
dev->name, instance, status);
goto error_iounmap;
}
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(1);
schedule_timeout_uninterruptible(1);
}
if (request_irq(dev->scsi_host_ptr->irq, aac_rx_intr, SA_SHIRQ|SA_INTERRUPT, "aacraid", (void *)dev)<0)
{

View file

@ -189,8 +189,7 @@ static int sa_sync_cmd(struct aac_dev *dev, u32 command,
ok = 1;
break;
}
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(1);
schedule_timeout_uninterruptible(1);
}
if (ok != 1)
@ -325,8 +324,7 @@ int aac_sa_init(struct aac_dev *dev)
name, instance, status);
goto error_iounmap;
}
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(1);
schedule_timeout_uninterruptible(1);
}
if (request_irq(dev->scsi_host_ptr->irq, aac_sa_intr, SA_SHIRQ|SA_INTERRUPT, "aacraid", (void *)dev ) < 0) {

View file

@ -5402,10 +5402,8 @@ advansys_detect(struct scsi_host_template *tpnt)
release_region(shp->io_port, boardp->asc_n_io_port);
if (ASC_WIDE_BOARD(boardp)) {
iounmap(boardp->ioremap_addr);
if (boardp->orig_carrp) {
kfree(boardp->orig_carrp);
boardp->orig_carrp = NULL;
}
kfree(boardp->orig_carrp);
boardp->orig_carrp = NULL;
if (boardp->orig_reqp) {
kfree(boardp->orig_reqp);
boardp->orig_reqp = boardp->adv_reqp = NULL;
@ -5457,10 +5455,8 @@ advansys_release(struct Scsi_Host *shp)
adv_sgblk_t *sgp = NULL;
iounmap(boardp->ioremap_addr);
if (boardp->orig_carrp) {
kfree(boardp->orig_carrp);
boardp->orig_carrp = NULL;
}
kfree(boardp->orig_carrp);
boardp->orig_carrp = NULL;
if (boardp->orig_reqp) {
kfree(boardp->orig_reqp);
boardp->orig_reqp = boardp->adv_reqp = NULL;

View file

@ -543,10 +543,8 @@ static void aha1542_intr_handle(struct Scsi_Host *shost, void *dev_id, struct pt
return;
}
my_done = SCtmp->scsi_done;
if (SCtmp->host_scribble) {
kfree(SCtmp->host_scribble);
SCtmp->host_scribble = NULL;
}
kfree(SCtmp->host_scribble);
SCtmp->host_scribble = NULL;
/* Fetch the sense data, and tuck it away, in the required slot. The
Adaptec automatically fetches it, and there is no guarantee that
we will still have it in the cdb when we come back */
@ -1432,10 +1430,8 @@ static int aha1542_dev_reset(Scsi_Cmnd * SCpnt)
HOSTDATA(SCpnt->host)->SCint[i]->target == SCpnt->target) {
Scsi_Cmnd *SCtmp;
SCtmp = HOSTDATA(SCpnt->host)->SCint[i];
if (SCtmp->host_scribble) {
kfree(SCtmp->host_scribble);
SCtmp->host_scribble = NULL;
}
kfree(SCtmp->host_scribble);
SCtmp->host_scribble = NULL;
HOSTDATA(SCpnt->host)->SCint[i] = NULL;
HOSTDATA(SCpnt->host)->mb[i].status = 0;
}
@ -1495,10 +1491,8 @@ static int aha1542_bus_reset(Scsi_Cmnd * SCpnt)
*/
continue;
}
if (SCtmp->host_scribble) {
kfree(SCtmp->host_scribble);
SCtmp->host_scribble = NULL;
}
kfree(SCtmp->host_scribble);
SCtmp->host_scribble = NULL;
HOSTDATA(SCpnt->device->host)->SCint[i] = NULL;
HOSTDATA(SCpnt->device->host)->mb[i].status = 0;
}
@ -1565,10 +1559,8 @@ static int aha1542_host_reset(Scsi_Cmnd * SCpnt)
*/
continue;
}
if (SCtmp->host_scribble) {
kfree(SCtmp->host_scribble);
SCtmp->host_scribble = NULL;
}
kfree(SCtmp->host_scribble);
SCtmp->host_scribble = NULL;
HOSTDATA(SCpnt->device->host)->SCint[i] = NULL;
HOSTDATA(SCpnt->device->host)->mb[i].status = 0;
}
@ -1711,10 +1703,8 @@ static int aha1542_old_reset(Scsi_Cmnd * SCpnt, unsigned int reset_flags)
Scsi_Cmnd *SCtmp;
SCtmp = HOSTDATA(SCpnt->host)->SCint[i];
SCtmp->result = DID_RESET << 16;
if (SCtmp->host_scribble) {
kfree(SCtmp->host_scribble);
SCtmp->host_scribble = NULL;
}
kfree(SCtmp->host_scribble);
SCtmp->host_scribble = NULL;
printk(KERN_WARNING "Sending DID_RESET for target %d\n", SCpnt->target);
SCtmp->scsi_done(SCpnt);
@ -1757,10 +1747,8 @@ fail:
Scsi_Cmnd *SCtmp;
SCtmp = HOSTDATA(SCpnt->host)->SCint[i];
SCtmp->result = DID_RESET << 16;
if (SCtmp->host_scribble) {
kfree(SCtmp->host_scribble);
SCtmp->host_scribble = NULL;
}
kfree(SCtmp->host_scribble);
SCtmp->host_scribble = NULL;
printk(KERN_WARNING "Sending DID_RESET for target %d\n", SCpnt->target);
SCtmp->scsi_done(SCpnt);

View file

@ -8492,8 +8492,7 @@ aic7xxx_free(struct aic7xxx_host *p)
- scb_dma->dma_offset),
scb_dma->dma_address);
}
if (p->scb_data->scb_array[i]->kmalloc_ptr != NULL)
kfree(p->scb_data->scb_array[i]->kmalloc_ptr);
kfree(p->scb_data->scb_array[i]->kmalloc_ptr);
p->scb_data->scb_array[i] = NULL;
}

View file

@ -91,8 +91,7 @@ void queue_free (Queue_t *queue)
{
if (!list_empty(&queue->head))
printk(KERN_WARNING "freeing non-empty queue %p\n", queue);
if (queue->alloc)
kfree(queue->alloc);
kfree(queue->alloc);
}

View file

@ -19,6 +19,8 @@
* this code.
*/
#include <linux/compiler.h>
#include <asm/thread_info.h>
#include <asm/uaccess.h>
#define hades_dma_ctrl (*(unsigned char *) 0xffff8717)

View file

@ -4270,8 +4270,7 @@ static void adapter_sg_tables_free(struct AdapterCtlBlk *acb)
const unsigned srbs_per_page = PAGE_SIZE/SEGMENTX_LEN;
for (i = 0; i < DC395x_MAX_SRB_CNT; i += srbs_per_page)
if (acb->srb_array[i].segment_x)
kfree(acb->srb_array[i].segment_x);
kfree(acb->srb_array[i].segment_x);
}

View file

@ -1037,18 +1037,10 @@ static void adpt_i2o_delete_hba(adpt_hba* pHba)
if(pHba->msg_addr_virt != pHba->base_addr_virt){
iounmap(pHba->msg_addr_virt);
}
if(pHba->hrt) {
kfree(pHba->hrt);
}
if(pHba->lct){
kfree(pHba->lct);
}
if(pHba->status_block) {
kfree(pHba->status_block);
}
if(pHba->reply_pool){
kfree(pHba->reply_pool);
}
kfree(pHba->hrt);
kfree(pHba->lct);
kfree(pHba->status_block);
kfree(pHba->reply_pool);
for(d = pHba->devices; d ; d = next){
next = d->next;
@ -1218,8 +1210,7 @@ static s32 adpt_i2o_post_this(adpt_hba* pHba, u32* data, int len)
printk(KERN_WARNING"dpti%d: Timeout waiting for message frame!\n", pHba->unit);
return -ETIMEDOUT;
}
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(1);
schedule_timeout_uninterruptible(1);
} while(m == EMPTY_QUEUE);
msg = pHba->msg_addr_virt + m;
@ -1294,8 +1285,7 @@ static s32 adpt_i2o_reset_hba(adpt_hba* pHba)
printk(KERN_WARNING"Timeout waiting for message!\n");
return -ETIMEDOUT;
}
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(1);
schedule_timeout_uninterruptible(1);
} while (m == EMPTY_QUEUE);
status = (u8*)kmalloc(4, GFP_KERNEL|ADDR32);
@ -1327,8 +1317,7 @@ static s32 adpt_i2o_reset_hba(adpt_hba* pHba)
return -ETIMEDOUT;
}
rmb();
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(1);
schedule_timeout_uninterruptible(1);
}
if(*status == 0x01 /*I2O_EXEC_IOP_RESET_IN_PROGRESS*/) {
@ -1345,8 +1334,7 @@ static s32 adpt_i2o_reset_hba(adpt_hba* pHba)
printk(KERN_ERR "%s:Timeout waiting for IOP Reset.\n",pHba->name);
return -ETIMEDOUT;
}
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(1);
schedule_timeout_uninterruptible(1);
} while (m == EMPTY_QUEUE);
// Flush the offset
adpt_send_nop(pHba, m);
@ -1917,11 +1905,8 @@ static int adpt_ioctl(struct inode *inode, struct file *file, uint cmd,
return -ENXIO;
}
while((volatile u32) pHba->state & DPTI_STATE_RESET ) {
set_task_state(current,TASK_UNINTERRUPTIBLE);
schedule_timeout(2);
}
while((volatile u32) pHba->state & DPTI_STATE_RESET )
schedule_timeout_uninterruptible(2);
switch (cmd) {
// TODO: handle 3 cases
@ -2635,8 +2620,7 @@ static s32 adpt_send_nop(adpt_hba*pHba,u32 m)
printk(KERN_ERR "%s: Timeout waiting for message frame!\n",pHba->name);
return 2;
}
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(1);
schedule_timeout_uninterruptible(1);
}
msg = (u32 __iomem *)(pHba->msg_addr_virt + m);
writel( THREE_WORD_MSG_SIZE | SGL_OFFSET_0,&msg[0]);
@ -2670,8 +2654,7 @@ static s32 adpt_i2o_init_outbound_q(adpt_hba* pHba)
printk(KERN_WARNING"%s: Timeout waiting for message frame\n",pHba->name);
return -ETIMEDOUT;
}
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(1);
schedule_timeout_uninterruptible(1);
} while(m == EMPTY_QUEUE);
msg=(u32 __iomem *)(pHba->msg_addr_virt+m);
@ -2709,21 +2692,18 @@ static s32 adpt_i2o_init_outbound_q(adpt_hba* pHba)
printk(KERN_WARNING"%s: Timeout Initializing\n",pHba->name);
return -ETIMEDOUT;
}
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(1);
schedule_timeout_uninterruptible(1);
} while (1);
// If the command was successful, fill the fifo with our reply
// message packets
if(*status != 0x04 /*I2O_EXEC_OUTBOUND_INIT_COMPLETE*/) {
kfree((void*)status);
kfree(status);
return -2;
}
kfree((void*)status);
kfree(status);
if(pHba->reply_pool != NULL){
kfree(pHba->reply_pool);
}
kfree(pHba->reply_pool);
pHba->reply_pool = (u32*)kmalloc(pHba->reply_fifo_size * REPLY_FRAME_SIZE * 4, GFP_KERNEL|ADDR32);
if(!pHba->reply_pool){
@ -2788,8 +2768,7 @@ static s32 adpt_i2o_status_get(adpt_hba* pHba)
pHba->name);
return -ETIMEDOUT;
}
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(1);
schedule_timeout_uninterruptible(1);
} while(m==EMPTY_QUEUE);
@ -2816,8 +2795,7 @@ static s32 adpt_i2o_status_get(adpt_hba* pHba)
return -ETIMEDOUT;
}
rmb();
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(1);
schedule_timeout_uninterruptible(1);
}
// Set up our number of outbound and inbound messages
@ -2941,8 +2919,7 @@ static int adpt_i2o_build_sys_table(void)
sys_tbl_len = sizeof(struct i2o_sys_tbl) + // Header + IOPs
(hba_count) * sizeof(struct i2o_sys_tbl_entry);
if(sys_tbl)
kfree(sys_tbl);
kfree(sys_tbl);
sys_tbl = kmalloc(sys_tbl_len, GFP_KERNEL|ADDR32);
if(!sys_tbl) {

View file

@ -2580,8 +2580,7 @@ static int eata2x_release(struct Scsi_Host *shost)
unsigned int i;
for (i = 0; i < shost->can_queue; i++)
if ((&ha->cp[i])->sglist)
kfree((&ha->cp[i])->sglist);
kfree((&ha->cp[i])->sglist);
for (i = 0; i < shost->can_queue; i++)
pci_unmap_single(ha->pdev, ha->cp[i].cp_dma_addr,

View file

@ -331,9 +331,9 @@ static int idescsi_check_condition(ide_drive_t *drive, struct request *failed_co
rq = kmalloc (sizeof (struct request), GFP_ATOMIC);
buf = kmalloc(SCSI_SENSE_BUFFERSIZE, GFP_ATOMIC);
if (pc == NULL || rq == NULL || buf == NULL) {
if (pc) kfree(pc);
if (rq) kfree(rq);
if (buf) kfree(buf);
kfree(buf);
kfree(rq);
kfree(pc);
return -ENOMEM;
}
memset (pc, 0, sizeof (idescsi_pc_t));
@ -949,8 +949,8 @@ static int idescsi_queue (struct scsi_cmnd *cmd,
spin_lock_irq(host->host_lock);
return 0;
abort:
if (pc) kfree (pc);
if (rq) kfree (rq);
kfree (pc);
kfree (rq);
cmd->result = DID_ERROR << 16;
done(cmd);
return 0;

View file

@ -4517,10 +4517,8 @@ ips_free(ips_ha_t * ha)
ha->enq = NULL;
}
if (ha->conf) {
kfree(ha->conf);
ha->conf = NULL;
}
kfree(ha->conf);
ha->conf = NULL;
if (ha->adapt) {
pci_free_consistent(ha->pcidev,
@ -4538,15 +4536,11 @@ ips_free(ips_ha_t * ha)
ha->logical_drive_info = NULL;
}
if (ha->nvram) {
kfree(ha->nvram);
ha->nvram = NULL;
}
kfree(ha->nvram);
ha->nvram = NULL;
if (ha->subsys) {
kfree(ha->subsys);
ha->subsys = NULL;
}
kfree(ha->subsys);
ha->subsys = NULL;
if (ha->ioctl_data) {
pci_free_consistent(ha->pcidev, ha->ioctl_len,

View file

@ -127,8 +127,7 @@ lpfc_prep_els_iocb(struct lpfc_hba * phba,
if (((pcmd = kmalloc(sizeof (struct lpfc_dmabuf), GFP_KERNEL)) == 0) ||
((pcmd->virt = lpfc_mbuf_alloc(phba,
MEM_PRI, &(pcmd->phys))) == 0)) {
if (pcmd)
kfree(pcmd);
kfree(pcmd);
spin_lock_irq(phba->host->host_lock);
lpfc_sli_release_iocbq(phba, elsiocb);
@ -145,8 +144,7 @@ lpfc_prep_els_iocb(struct lpfc_hba * phba,
prsp->virt = lpfc_mbuf_alloc(phba, MEM_PRI,
&prsp->phys);
if (prsp == 0 || prsp->virt == 0) {
if (prsp)
kfree(prsp);
kfree(prsp);
lpfc_mbuf_free(phba, pcmd->virt, pcmd->phys);
kfree(pcmd);
spin_lock_irq(phba->host->host_lock);
@ -172,8 +170,7 @@ lpfc_prep_els_iocb(struct lpfc_hba * phba,
lpfc_mbuf_free(phba, prsp->virt, prsp->phys);
kfree(pcmd);
kfree(prsp);
if (pbuflist)
kfree(pbuflist);
kfree(pbuflist);
return NULL;
}

View file

@ -894,8 +894,7 @@ lpfc_post_buffer(struct lpfc_hba * phba, struct lpfc_sli_ring * pring, int cnt,
mp1->virt = lpfc_mbuf_alloc(phba, MEM_PRI,
&mp1->phys);
if (mp1 == 0 || mp1->virt == 0) {
if (mp1)
kfree(mp1);
kfree(mp1);
spin_lock_irq(phba->host->host_lock);
lpfc_sli_release_iocbq(phba, iocb);
spin_unlock_irq(phba->host->host_lock);
@ -911,8 +910,7 @@ lpfc_post_buffer(struct lpfc_hba * phba, struct lpfc_sli_ring * pring, int cnt,
mp2->virt = lpfc_mbuf_alloc(phba, MEM_PRI,
&mp2->phys);
if (mp2 == 0 || mp2->virt == 0) {
if (mp2)
kfree(mp2);
kfree(mp2);
lpfc_mbuf_free(phba, mp1->virt, mp1->phys);
kfree(mp1);
spin_lock_irq(phba->host->host_lock);

View file

@ -248,8 +248,7 @@ lpfc_read_sparam(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmb)
if (((mp = kmalloc(sizeof (struct lpfc_dmabuf), GFP_KERNEL)) == 0) ||
((mp->virt = lpfc_mbuf_alloc(phba, 0, &(mp->phys))) == 0)) {
if (mp)
kfree(mp);
kfree(mp);
mb->mbxCommand = MBX_READ_SPARM64;
/* READ_SPARAM: no buffers */
lpfc_printf_log(phba,
@ -363,9 +362,7 @@ lpfc_reg_login(struct lpfc_hba * phba,
/* Get a buffer to hold NPorts Service Parameters */
if (((mp = kmalloc(sizeof (struct lpfc_dmabuf), GFP_KERNEL)) == NULL) ||
((mp->virt = lpfc_mbuf_alloc(phba, 0, &(mp->phys))) == 0)) {
if (mp)
kfree(mp);
kfree(mp);
mb->mbxCommand = MBX_REG_LOGIN64;
/* REG_LOGIN: no buffers */
lpfc_printf_log(phba,

View file

@ -825,8 +825,7 @@ __lpfc_abort_handler(struct scsi_cmnd *cmnd)
while (lpfc_cmd->pCmd == cmnd)
{
spin_unlock_irq(phba->host->host_lock);
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(LPFC_ABORT_WAIT*HZ);
schedule_timeout_uninterruptible(LPFC_ABORT_WAIT*HZ);
spin_lock_irq(phba->host->host_lock);
if (++loop_count
> (2 * phba->cfg_nodev_tmo)/LPFC_ABORT_WAIT)
@ -885,8 +884,7 @@ __lpfc_reset_lun_handler(struct scsi_cmnd *cmnd)
if (pnode->nlp_state != NLP_STE_MAPPED_NODE) {
spin_unlock_irq(phba->host->host_lock);
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout( HZ/2);
schedule_timeout_uninterruptible(msecs_to_jiffies(500));
spin_lock_irq(phba->host->host_lock);
}
if ((pnode) && (pnode->nlp_state == NLP_STE_MAPPED_NODE))
@ -939,8 +937,7 @@ __lpfc_reset_lun_handler(struct scsi_cmnd *cmnd)
cmnd->device->id, cmnd->device->lun,
LPFC_CTX_LUN))) {
spin_unlock_irq(phba->host->host_lock);
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(LPFC_RESET_WAIT*HZ);
schedule_timeout_uninterruptible(LPFC_RESET_WAIT*HZ);
spin_lock_irq(phba->host->host_lock);
if (++loopcnt
@ -1038,8 +1035,7 @@ __lpfc_reset_bus_handler(struct scsi_cmnd *cmnd)
&phba->sli.ring[phba->sli.fcp_ring],
0, 0, LPFC_CTX_HOST))) {
spin_unlock_irq(phba->host->host_lock);
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(LPFC_RESET_WAIT*HZ);
schedule_timeout_uninterruptible(LPFC_RESET_WAIT*HZ);
spin_lock_irq(phba->host->host_lock);
if (++loopcnt

View file

@ -2269,11 +2269,8 @@ lpfc_sli_hba_down(struct lpfc_hba * phba)
INIT_LIST_HEAD(&(pring->txq));
if (pring->fast_lookup) {
kfree(pring->fast_lookup);
pring->fast_lookup = NULL;
}
kfree(pring->fast_lookup);
pring->fast_lookup = NULL;
}
spin_unlock_irqrestore(phba->host->host_lock, flags);

View file

@ -3937,9 +3937,8 @@ megaraid_sysfs_free_resources(adapter_t *adapter)
{
mraid_device_t *raid_dev = ADAP2RAIDDEV(adapter);
if (raid_dev->sysfs_uioc) kfree(raid_dev->sysfs_uioc);
if (raid_dev->sysfs_mbox64) kfree(raid_dev->sysfs_mbox64);
kfree(raid_dev->sysfs_uioc);
kfree(raid_dev->sysfs_mbox64);
if (raid_dev->sysfs_buffer) {
pci_free_consistent(adapter->pdev, PAGE_SIZE,

View file

@ -995,17 +995,13 @@ pthru_dma_pool_error:
memalloc_error:
if (adapter->kioc_list)
kfree(adapter->kioc_list);
if (adapter->mbox_list)
kfree(adapter->mbox_list);
kfree(adapter->kioc_list);
kfree(adapter->mbox_list);
if (adapter->pthru_dma_pool)
pci_pool_destroy(adapter->pthru_dma_pool);
if (adapter)
kfree(adapter);
kfree(adapter);
return rval;
}
@ -1157,7 +1153,6 @@ mraid_mm_free_adp_resources(mraid_mmadp_t *adp)
}
kfree(adp->kioc_list);
kfree(adp->mbox_list);
pci_pool_destroy(adp->pthru_dma_pool);

View file

@ -862,8 +862,7 @@ static int osst_recover_wait_frame(struct osst_tape * STp, struct scsi_request *
retval = osst_write_error_recovery(STp, aSRpnt, 0);
break;
}
set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout (HZ / OSST_POLL_PER_SEC);
schedule_timeout_interruptible(HZ / OSST_POLL_PER_SEC);
STp->buffer->b_data = mybuf; STp->buffer->buffer_size = 24;
memset(cmd, 0, MAX_COMMAND_SIZE);
@ -1558,8 +1557,7 @@ static int osst_reposition_and_retry(struct osst_tape * STp, struct scsi_request
osst_set_frame_position(STp, aSRpnt, frame + skip, 1);
flag = 0;
attempts--;
set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(HZ / 10);
schedule_timeout_interruptible(msecs_to_jiffies(100));
}
if (osst_get_frame_position(STp, aSRpnt) < 0) { /* additional write error */
#if DEBUG
@ -1620,8 +1618,7 @@ static int osst_reposition_and_retry(struct osst_tape * STp, struct scsi_request
debugging = 0;
}
#endif
set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(HZ / 10);
schedule_timeout_interruptible(msecs_to_jiffies(100));
}
printk(KERN_ERR "%s:E: Failed to find valid tape media\n", name);
#if DEBUG

View file

@ -1977,8 +1977,7 @@ qla2x00_configure_local_loop(scsi_qla_host_t *ha)
}
cleanup_allocation:
if (new_fcport)
kfree(new_fcport);
kfree(new_fcport);
if (rval != QLA_SUCCESS) {
DEBUG2(printk("scsi(%ld): Configure local loop error exit: "
@ -2348,8 +2347,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *ha, struct list_head *new_fcports)
/* Allocate temporary fcport for any new fcports discovered. */
new_fcport = qla2x00_alloc_fcport(ha, GFP_KERNEL);
if (new_fcport == NULL) {
if (swl)
kfree(swl);
kfree(swl);
return (QLA_MEMORY_ALLOC_FAILED);
}
new_fcport->flags |= (FCF_FABRIC_DEVICE | FCF_LOGIN_NEEDED);
@ -2485,19 +2483,15 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *ha, struct list_head *new_fcports)
nxt_d_id.b24 = new_fcport->d_id.b24;
new_fcport = qla2x00_alloc_fcport(ha, GFP_KERNEL);
if (new_fcport == NULL) {
if (swl)
kfree(swl);
kfree(swl);
return (QLA_MEMORY_ALLOC_FAILED);
}
new_fcport->flags |= (FCF_FABRIC_DEVICE | FCF_LOGIN_NEEDED);
new_fcport->d_id.b24 = nxt_d_id.b24;
}
if (swl)
kfree(swl);
if (new_fcport)
kfree(new_fcport);
kfree(swl);
kfree(new_fcport);
if (!list_empty(new_fcports))
ha->device_flags |= DFLG_FABRIC_DEVICES;

View file

@ -4,6 +4,8 @@
#include <linux/init.h>
#include <linux/module.h>
#include <linux/list.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/raid_class.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_host.h>

View file

@ -26,6 +26,8 @@
#include <linux/init.h>
#include <linux/module.h>
#include <linux/err.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_host.h>

View file

@ -476,8 +476,7 @@ sg_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos)
sg_finish_rem_req(srp);
retval = count;
free_old_hdr:
if (old_hdr)
kfree(old_hdr);
kfree(old_hdr);
return retval;
}
@ -1703,10 +1702,8 @@ exit_sg(void)
sg_sysfs_valid = 0;
unregister_chrdev_region(MKDEV(SCSI_GENERIC_MAJOR, 0),
SG_MAX_DEVS);
if (sg_dev_arr != NULL) {
kfree((char *) sg_dev_arr);
sg_dev_arr = NULL;
}
kfree((char *)sg_dev_arr);
sg_dev_arr = NULL;
sg_dev_max = 0;
}

View file

@ -4107,8 +4107,7 @@ out_free_tape:
write_unlock(&st_dev_arr_lock);
out_put_disk:
put_disk(disk);
if (tpnt)
kfree(tpnt);
kfree(tpnt);
out_buffer_free:
kfree(buffer);
out:

View file

@ -39,6 +39,7 @@
*/
#include <linux/slab.h>
#include <asm/param.h> /* for timeouts in units of HZ */
#include "sym_glue.h"
#include "sym_nvram.h"

View file

@ -1953,11 +1953,11 @@ static int u14_34f_release(struct Scsi_Host *shpnt) {
for (j = 0; sh[j] != NULL && sh[j] != shpnt; j++);
if (sh[j] == NULL) panic("%s: release, invalid Scsi_Host pointer.\n",
driver_name);
if (sh[j] == NULL)
panic("%s: release, invalid Scsi_Host pointer.\n", driver_name);
for (i = 0; i < sh[j]->can_queue; i++)
if ((&HD(j)->cp[i])->sglist) kfree((&HD(j)->cp[i])->sglist);
kfree((&HD(j)->cp[i])->sglist);
for (i = 0; i < sh[j]->can_queue; i++)
pci_unmap_single(HD(j)->pdev, HD(j)->cp[i].cp_dma_addr,
@ -1965,7 +1965,8 @@ static int u14_34f_release(struct Scsi_Host *shpnt) {
free_irq(sh[j]->irq, &sha[j]);
if (sh[j]->dma_channel != NO_DMA) free_dma(sh[j]->dma_channel);
if (sh[j]->dma_channel != NO_DMA)
free_dma(sh[j]->dma_channel);
release_region(sh[j]->io_port, sh[j]->n_io_port);
scsi_unregister(sh[j]);