projects
/
GitHub
/
LineageOS
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
43339be
)
staging: usbip: use kcalloc instead of kzalloc for array allocations
author
Djordje Zekovic
<dj@zeko.me>
Fri, 23 May 2014 14:18:03 +0000
(14:18 +0000)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Fri, 23 May 2014 19:38:34 +0000
(
04:38
+0900)
The advantage of kcalloc is, that will prevent integer overflows which could
result from the multiplication of number of elements and size and it is also
a bit nicer to read.
Signed-off-by: Djordje Zekovic <dj@zeko.me>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/usbip/stub_tx.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/staging/usbip/stub_tx.c
b/drivers/staging/usbip/stub_tx.c
index 38fe551650c298e8cec34966befde6d2b52922ea..dbcabc9dbe0dc81c499902038515857d242d3fd5 100644
(file)
--- a/
drivers/staging/usbip/stub_tx.c
+++ b/
drivers/staging/usbip/stub_tx.c
@@
-179,7
+179,7
@@
static int stub_send_ret_submit(struct stub_device *sdev)
else
iovnum = 2;
- iov = k
zalloc(iovnum *
sizeof(struct kvec), GFP_KERNEL);
+ iov = k
calloc(iovnum,
sizeof(struct kvec), GFP_KERNEL);
if (!iov) {
usbip_event_add(&sdev->ud, SDEV_EVENT_ERROR_MALLOC);