diff options
author | Djordje Zekovic <dj@zeko.me> | 2014-05-23 18:18:03 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-05-23 23:38:34 +0400 |
commit | 6baf139e8b0efd7450cca792db5a37b0bccb8761 (patch) | |
tree | 4a93d09feb2fcf9816386beaee936c2bd1036118 /drivers/staging/usbip | |
parent | 43339bed7010da6e7cf797db3216a136a974a0cd (diff) | |
download | linux-6baf139e8b0efd7450cca792db5a37b0bccb8761.tar.xz |
staging: usbip: use kcalloc instead of kzalloc for array allocations
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>
Diffstat (limited to 'drivers/staging/usbip')
-rw-r--r-- | drivers/staging/usbip/stub_tx.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/usbip/stub_tx.c b/drivers/staging/usbip/stub_tx.c index 38fe551650c2..dbcabc9dbe0d 100644 --- 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 = kzalloc(iovnum * sizeof(struct kvec), GFP_KERNEL); + iov = kcalloc(iovnum, sizeof(struct kvec), GFP_KERNEL); if (!iov) { usbip_event_add(&sdev->ud, SDEV_EVENT_ERROR_MALLOC); |