diff options
Diffstat (limited to 'drivers/usb/serial/cp2101.c')
-rw-r--r-- | drivers/usb/serial/cp2101.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/usb/serial/cp2101.c b/drivers/usb/serial/cp2101.c index dc7a069503e0..9ea7b4a4a22b 100644 --- a/drivers/usb/serial/cp2101.c +++ b/drivers/usb/serial/cp2101.c | |||
@@ -169,9 +169,7 @@ static int cp2101_get_config(struct usb_serial_port* port, u8 request, | |||
169 | /* Number of integers required to contain the array */ | 169 | /* Number of integers required to contain the array */ |
170 | length = (((size - 1) | 3) + 1)/4; | 170 | length = (((size - 1) | 3) + 1)/4; |
171 | 171 | ||
172 | buf = kmalloc (length * sizeof(u32), GFP_KERNEL); | 172 | buf = kcalloc(length, sizeof(u32), GFP_KERNEL); |
173 | memset(buf, 0, length * sizeof(u32)); | ||
174 | |||
175 | if (!buf) { | 173 | if (!buf) { |
176 | dev_err(&port->dev, "%s - out of memory.\n", __FUNCTION__); | 174 | dev_err(&port->dev, "%s - out of memory.\n", __FUNCTION__); |
177 | return -ENOMEM; | 175 | return -ENOMEM; |