Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 13928
b: refs/heads/master
c: 0bc42e3
h: refs/heads/master
v: v3
  • Loading branch information
brking@us.ibm.com authored and James Bottomley committed Nov 6, 2005
1 parent de51e55 commit 75eb949
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 622750406a1b4b230f1ee595cb555e5d9222feeb
refs/heads/master: 0bc42e35c74c0baab414cf623d6fe1e94cee4ca3
18 changes: 4 additions & 14 deletions trunk/drivers/scsi/ipr.c
Original file line number Diff line number Diff line change
Expand Up @@ -2248,7 +2248,7 @@ static struct ipr_sglist *ipr_alloc_ucode_buffer(int buf_len)
num_elem = buf_len / bsize_elem;

/* Allocate a scatter/gather list for the DMA */
sglist = kmalloc(sizeof(struct ipr_sglist) +
sglist = kzalloc(sizeof(struct ipr_sglist) +
(sizeof(struct scatterlist) * (num_elem - 1)),
GFP_KERNEL);

Expand All @@ -2257,9 +2257,6 @@ static struct ipr_sglist *ipr_alloc_ucode_buffer(int buf_len)
return NULL;
}

memset(sglist, 0, sizeof(struct ipr_sglist) +
(sizeof(struct scatterlist) * (num_elem - 1)));

scatterlist = sglist->scatterlist;

sglist->order = order;
Expand Down Expand Up @@ -2614,14 +2611,13 @@ static int ipr_alloc_dump(struct ipr_ioa_cfg *ioa_cfg)
unsigned long lock_flags = 0;

ENTER;
dump = kmalloc(sizeof(struct ipr_dump), GFP_KERNEL);
dump = kzalloc(sizeof(struct ipr_dump), GFP_KERNEL);

if (!dump) {
ipr_err("Dump memory allocation failed\n");
return -ENOMEM;
}

memset(dump, 0, sizeof(struct ipr_dump));
kref_init(&dump->kref);
dump->ioa_cfg = ioa_cfg;

Expand Down Expand Up @@ -5665,15 +5661,12 @@ static int __devinit ipr_alloc_mem(struct ipr_ioa_cfg *ioa_cfg)
int i, rc = -ENOMEM;

ENTER;
ioa_cfg->res_entries = kmalloc(sizeof(struct ipr_resource_entry) *
ioa_cfg->res_entries = kzalloc(sizeof(struct ipr_resource_entry) *
IPR_MAX_PHYSICAL_DEVS, GFP_KERNEL);

if (!ioa_cfg->res_entries)
goto out;

memset(ioa_cfg->res_entries, 0,
sizeof(struct ipr_resource_entry) * IPR_MAX_PHYSICAL_DEVS);

for (i = 0; i < IPR_MAX_PHYSICAL_DEVS; i++)
list_add_tail(&ioa_cfg->res_entries[i].queue, &ioa_cfg->free_res_q);

Expand Down Expand Up @@ -5714,15 +5707,12 @@ static int __devinit ipr_alloc_mem(struct ipr_ioa_cfg *ioa_cfg)
list_add_tail(&ioa_cfg->hostrcb[i]->queue, &ioa_cfg->hostrcb_free_q);
}

ioa_cfg->trace = kmalloc(sizeof(struct ipr_trace_entry) *
ioa_cfg->trace = kzalloc(sizeof(struct ipr_trace_entry) *
IPR_NUM_TRACE_ENTRIES, GFP_KERNEL);

if (!ioa_cfg->trace)
goto out_free_hostrcb_dma;

memset(ioa_cfg->trace, 0,
sizeof(struct ipr_trace_entry) * IPR_NUM_TRACE_ENTRIES);

rc = 0;
out:
LEAVE;
Expand Down

0 comments on commit 75eb949

Please sign in to comment.