Commit 92c4d9bd authored by David Vrabel's avatar David Vrabel

uwb: use kcalloc where appropriate

Signed-off-by: default avatarDavid Vrabel <david.vrabel@csr.com>
parent 45c16cd9
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
int wusbhc_mmcie_create(struct wusbhc *wusbhc) int wusbhc_mmcie_create(struct wusbhc *wusbhc)
{ {
u8 mmcies = wusbhc->mmcies_max; u8 mmcies = wusbhc->mmcies_max;
wusbhc->mmcie = kzalloc(mmcies * sizeof(wusbhc->mmcie[0]), GFP_KERNEL); wusbhc->mmcie = kcalloc(mmcies, sizeof(wusbhc->mmcie[0]), GFP_KERNEL);
if (wusbhc->mmcie == NULL) if (wusbhc->mmcie == NULL)
return -ENOMEM; return -ENOMEM;
mutex_init(&wusbhc->mmcie_mutex); mutex_init(&wusbhc->mmcie_mutex);
......
...@@ -674,7 +674,7 @@ static int __wa_xfer_setup_segs(struct wa_xfer *xfer, size_t xfer_hdr_size) ...@@ -674,7 +674,7 @@ static int __wa_xfer_setup_segs(struct wa_xfer *xfer, size_t xfer_hdr_size)
size_t buf_itr, buf_size, buf_itr_size; size_t buf_itr, buf_size, buf_itr_size;
result = -ENOMEM; result = -ENOMEM;
xfer->seg = kzalloc(xfer->segs * sizeof(xfer->seg[0]), GFP_ATOMIC); xfer->seg = kcalloc(xfer->segs, sizeof(xfer->seg[0]), GFP_ATOMIC);
if (xfer->seg == NULL) if (xfer->seg == NULL)
goto error_segs_kzalloc; goto error_segs_kzalloc;
buf_itr = 0; buf_itr = 0;
......
...@@ -443,7 +443,7 @@ void uwbd_dev_onair(struct uwb_rc *rc, struct uwb_beca_e *bce) ...@@ -443,7 +443,7 @@ void uwbd_dev_onair(struct uwb_rc *rc, struct uwb_beca_e *bce)
uwb_mac_addr_print(macbuf, sizeof(macbuf), bce->mac_addr); uwb_mac_addr_print(macbuf, sizeof(macbuf), bce->mac_addr);
uwb_dev_addr_print(devbuf, sizeof(devbuf), &bce->dev_addr); uwb_dev_addr_print(devbuf, sizeof(devbuf), &bce->dev_addr);
uwb_dev = kcalloc(1, sizeof(*uwb_dev), GFP_KERNEL); uwb_dev = kzalloc(sizeof(struct uwb_dev), GFP_KERNEL);
if (uwb_dev == NULL) { if (uwb_dev == NULL) {
dev_err(dev, "new device %s: Cannot allocate memory\n", dev_err(dev, "new device %s: Cannot allocate memory\n",
macbuf); macbuf);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment