Commit 1ff8950c authored by yalin wang's avatar yalin wang Committed by Ulf Hansson

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: default avataryalin wang <yalin.wang2010@gmail.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 6e1bbc51
...@@ -344,7 +344,7 @@ static struct mmc_blk_ioc_data *mmc_blk_ioctl_copy_from_user( ...@@ -344,7 +344,7 @@ static struct mmc_blk_ioc_data *mmc_blk_ioctl_copy_from_user(
struct mmc_blk_ioc_data *idata; struct mmc_blk_ioc_data *idata;
int err; int err;
idata = kzalloc(sizeof(*idata), GFP_KERNEL); idata = kmalloc(sizeof(*idata), GFP_KERNEL);
if (!idata) { if (!idata) {
err = -ENOMEM; err = -ENOMEM;
goto out; goto out;
...@@ -364,7 +364,7 @@ static struct mmc_blk_ioc_data *mmc_blk_ioctl_copy_from_user( ...@@ -364,7 +364,7 @@ static struct mmc_blk_ioc_data *mmc_blk_ioctl_copy_from_user(
if (!idata->buf_bytes) if (!idata->buf_bytes)
return idata; return idata;
idata->buf = kzalloc(idata->buf_bytes, GFP_KERNEL); idata->buf = kmalloc(idata->buf_bytes, GFP_KERNEL);
if (!idata->buf) { if (!idata->buf) {
err = -ENOMEM; err = -ENOMEM;
goto idata_err; goto idata_err;
......
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