Commit 5e757bc5 authored by Shraddha Barke's avatar Shraddha Barke Committed by Greg Kroah-Hartman
Browse files

Staging: unisys: Use kcalloc instead of kzalloc to allocate array



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: default avatarShraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bb30b15a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1797,8 +1797,8 @@ static int visornic_probe(struct visor_device *dev)
		goto cleanup_netdev;
	}

	devdata->rcvbuf = kzalloc(sizeof(struct sk_buff *) *
				  devdata->num_rcv_bufs, GFP_KERNEL);
	devdata->rcvbuf = kcalloc(devdata->num_rcv_bufs,
				  sizeof(struct sk_buff *), GFP_KERNEL);
	if (!devdata->rcvbuf) {
		err = -ENOMEM;
		goto cleanup_rcvbuf;