mmc: block: change to use kmalloc when copy data from userspace
authoryalin wang <yalin.wang2010@gmail.com>
Thu, 12 Nov 2015 11:27:11 +0000 (19:27 +0800)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 22 Dec 2015 10:32:05 +0000 (11:32 +0100)
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>
drivers/mmc/card/block.c

index d8486168415ae1123f6a31d7126cfc9192fe884b..ce38960cca12f3dbdcd624aa23ae56a5b0c59bfb 100644 (file)
@@ -344,7 +344,7 @@ static struct mmc_blk_ioc_data *mmc_blk_ioctl_copy_from_user(
        struct mmc_blk_ioc_data *idata;
        int err;
 
-       idata = kzalloc(sizeof(*idata), GFP_KERNEL);
+       idata = kmalloc(sizeof(*idata), GFP_KERNEL);
        if (!idata) {
                err = -ENOMEM;
                goto out;
@@ -364,7 +364,7 @@ static struct mmc_blk_ioc_data *mmc_blk_ioctl_copy_from_user(
        if (!idata->buf_bytes)
                return idata;
 
-       idata->buf = kzalloc(idata->buf_bytes, GFP_KERNEL);
+       idata->buf = kmalloc(idata->buf_bytes, GFP_KERNEL);
        if (!idata->buf) {
                err = -ENOMEM;
                goto idata_err;