From: Alex Elder Date: Thu, 16 Oct 2014 11:35:28 +0000 (-0500) Subject: greybus: zero all data buffers X-Git-Tag: v4.9-rc1~119^2~378^2~21^2~2015 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a7901d5ef7ff6bb6b7fdc500d9383450b23ba059;p=karo-tx-linux.git greybus: zero all data buffers Don't assume the buffer data area will all be overwritten. Zero all buffer space, to avoid sending crap over the wire. Signed-off-by: Alex Elder Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/es1-ap-usb.c b/drivers/staging/greybus/es1-ap-usb.c index e55ad03b56d6..2405670d8afc 100644 --- a/drivers/staging/greybus/es1-ap-usb.c +++ b/drivers/staging/greybus/es1-ap-usb.c @@ -113,7 +113,7 @@ static int alloc_gbuf_data(struct gbuf *gbuf, unsigned int size, * CPort Id before the data; set aside an extra byte for * that purpose in that case. */ - buffer = kmalloc(cport_reserve + size, gfp_mask); + buffer = kzalloc(cport_reserve + size, gfp_mask); if (!buffer) return -ENOMEM;