Skip to content

Commit 1ff8950

Browse files
yalin wangstorulf
authored andcommitted
mmc: block: change to use kmalloc when copy data from userspace
Use kmalloc instead of kzalloc, as zeroing the memory isn't needed. Signed-off-by: yalin wang <yalin.wang2010@gmail.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent 6e1bbc5 commit 1ff8950

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/mmc/card/block.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ static struct mmc_blk_ioc_data *mmc_blk_ioctl_copy_from_user(
344344
struct mmc_blk_ioc_data *idata;
345345
int err;
346346

347-
idata = kzalloc(sizeof(*idata), GFP_KERNEL);
347+
idata = kmalloc(sizeof(*idata), GFP_KERNEL);
348348
if (!idata) {
349349
err = -ENOMEM;
350350
goto out;
@@ -364,7 +364,7 @@ static struct mmc_blk_ioc_data *mmc_blk_ioctl_copy_from_user(
364364
if (!idata->buf_bytes)
365365
return idata;
366366

367-
idata->buf = kzalloc(idata->buf_bytes, GFP_KERNEL);
367+
idata->buf = kmalloc(idata->buf_bytes, GFP_KERNEL);
368368
if (!idata->buf) {
369369
err = -ENOMEM;
370370
goto idata_err;

0 commit comments

Comments
 (0)