Skip to content

Commit

Permalink
staging: Convert vmalloc/memset to vzalloc
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Joe Perches authored and Greg Kroah-Hartman committed Jun 28, 2011
1 parent f5a22e9 commit fcfd8ac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions drivers/staging/rts_pstor/ms.c
Original file line number Diff line number Diff line change
Expand Up @@ -2064,11 +2064,10 @@ static int ms_init_l2p_tbl(struct rtsx_chip *chip)
RTSX_DEBUGP("ms_card->segment_cnt = %d\n", ms_card->segment_cnt);

size = ms_card->segment_cnt * sizeof(struct zone_entry);
ms_card->segment = (struct zone_entry *)vmalloc(size);
ms_card->segment = vzalloc(size);
if (ms_card->segment == NULL) {
TRACE_RET(chip, STATUS_FAIL);
}
memset(ms_card->segment, 0, size);

retval = ms_read_page(chip, ms_card->boot_block, 1);
if (retval != STATUS_SUCCESS) {
Expand Down
6 changes: 2 additions & 4 deletions drivers/staging/rts_pstor/rtsx_chip.c
Original file line number Diff line number Diff line change
Expand Up @@ -1596,18 +1596,16 @@ int rtsx_write_cfg_seq(struct rtsx_chip *chip, u8 func, u16 addr, u8 *buf, int l
}
RTSX_DEBUGP("dw_len = %d\n", dw_len);

data = (u32 *)vmalloc(dw_len * 4);
data = vzalloc(dw_len * 4);
if (!data) {
TRACE_RET(chip, STATUS_NOMEM);
}
memset(data, 0, dw_len * 4);

mask = (u32 *)vmalloc(dw_len * 4);
mask = vzalloc(dw_len * 4);
if (!mask) {
vfree(data);
TRACE_RET(chip, STATUS_NOMEM);
}
memset(mask, 0, dw_len * 4);

j = 0;
for (i = 0; i < len; i++) {
Expand Down

0 comments on commit fcfd8ac

Please sign in to comment.