From: Pan Zhang <zhangpan26@huawei.com>
To: <zhangpan26@huawei.com>, <hushiyuan@huawei.com>,
<ulf.hansson@linaro.org>, <allison@lohutok.net>,
<gregkh@linuxfoundation.org>, <tglx@linutronix.de>
Cc: <linux-mmc@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH] mmc: host: use kzalloc instead of kmalloc and memset
Date: Tue, 17 Dec 2019 15:00:37 +0800 [thread overview]
Message-ID: <1576566037-29837-1-git-send-email-zhangpan26@huawei.com> (raw)
Signed-off-by: Pan Zhang <zhangpan26@huawei.com>
---
drivers/mmc/host/vub300.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/mmc/host/vub300.c b/drivers/mmc/host/vub300.c
index 6ced1b7..e893ced 100644
--- a/drivers/mmc/host/vub300.c
+++ b/drivers/mmc/host/vub300.c
@@ -1227,12 +1227,10 @@ static void __download_offload_pseudocode(struct vub300_mmc_host *vub300,
size -= 1;
if (interrupt_size < size) {
u16 xfer_length = roundup_to_multiple_of_64(interrupt_size);
- u8 *xfer_buffer = kmalloc(xfer_length, GFP_KERNEL);
+ u8 *xfer_buffer = kzalloc(xfer_length, GFP_KERNEL);
if (xfer_buffer) {
int retval;
memcpy(xfer_buffer, data, interrupt_size);
- memset(xfer_buffer + interrupt_size, 0,
- xfer_length - interrupt_size);
size -= interrupt_size;
data += interrupt_size;
retval =
--
2.7.4
next reply other threads:[~2019-12-17 7:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-17 7:00 Pan Zhang [this message]
2019-12-17 7:32 ` [PATCH] mmc: host: use kzalloc instead of kmalloc and memset Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1576566037-29837-1-git-send-email-zhangpan26@huawei.com \
--to=zhangpan26@huawei.com \
--cc=allison@lohutok.net \
--cc=gregkh@linuxfoundation.org \
--cc=hushiyuan@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=ulf.hansson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.