Commit fcfd8ac0 authored by Joe Perches's avatar Joe Perches Committed by Greg Kroah-Hartman

staging: Convert vmalloc/memset to vzalloc

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent f5a22e91
...@@ -2064,11 +2064,10 @@ static int ms_init_l2p_tbl(struct rtsx_chip *chip) ...@@ -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); RTSX_DEBUGP("ms_card->segment_cnt = %d\n", ms_card->segment_cnt);
size = ms_card->segment_cnt * sizeof(struct zone_entry); 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) { if (ms_card->segment == NULL) {
TRACE_RET(chip, STATUS_FAIL); TRACE_RET(chip, STATUS_FAIL);
} }
memset(ms_card->segment, 0, size);
retval = ms_read_page(chip, ms_card->boot_block, 1); retval = ms_read_page(chip, ms_card->boot_block, 1);
if (retval != STATUS_SUCCESS) { if (retval != STATUS_SUCCESS) {
......
...@@ -1596,18 +1596,16 @@ int rtsx_write_cfg_seq(struct rtsx_chip *chip, u8 func, u16 addr, u8 *buf, int l ...@@ -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); RTSX_DEBUGP("dw_len = %d\n", dw_len);
data = (u32 *)vmalloc(dw_len * 4); data = vzalloc(dw_len * 4);
if (!data) { if (!data) {
TRACE_RET(chip, STATUS_NOMEM); TRACE_RET(chip, STATUS_NOMEM);
} }
memset(data, 0, dw_len * 4);
mask = (u32 *)vmalloc(dw_len * 4); mask = vzalloc(dw_len * 4);
if (!mask) { if (!mask) {
vfree(data); vfree(data);
TRACE_RET(chip, STATUS_NOMEM); TRACE_RET(chip, STATUS_NOMEM);
} }
memset(mask, 0, dw_len * 4);
j = 0; j = 0;
for (i = 0; i < len; i++) { for (i = 0; i < len; i++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment