-/* $OpenBSD: dwc2_hcd.c,v 1.16 2015/06/28 11:48:18 jmatthew Exp $ */
+/* $OpenBSD: dwc2_hcd.c,v 1.17 2017/04/09 18:09:41 dhill Exp $ */
/* $NetBSD: dwc2_hcd.c,v 1.15 2014/11/24 10:14:14 skrll Exp $ */
/*
dev_dbg(hsotg->dev, "hcfg=%08x\n", DWC2_READ_4(hsotg, HCFG));
#ifdef CONFIG_USB_DWC2_TRACK_MISSED_SOFS
- hsotg->frame_num_array = malloc(sizeof(*hsotg->frame_num_array) *
- FRAME_NUM_ARRAY_SIZE, M_DEVBUF,
- M_ZERO | M_WAITOK);
+ hsotg->frame_num_array = mallocarray(FRAME_NUM_ARRAY_SIZE,
+ sizeof(*hsotg->frame_num_array),
+ M_DEVBUF, M_ZERO | M_WAITOK);
if (!hsotg->frame_num_array)
goto error1;
- hsotg->last_frame_num_array = malloc(
- sizeof(*hsotg->last_frame_num_array) *
- FRAME_NUM_ARRAY_SIZE, M_DEVBUF, M_ZERO | M_WAITOK);
+ hsotg->last_frame_num_array = mallocarray(FRAME_NUM_ARRAY_SIZE,
+ sizeof(*hsotg->last_frame_num_array),
+ M_DEVBUF, M_ZERO | M_WAITOK);
if (!hsotg->last_frame_num_array)
goto error1;
hsotg->last_frame_num = HFNUM_MAX_FRNUM;
-/* $OpenBSD: dwc2_hcdddma.c,v 1.11 2015/12/18 17:23:14 mmcc Exp $ */
+/* $OpenBSD: dwc2_hcdddma.c,v 1.12 2017/04/09 18:09:41 dhill Exp $ */
/* $NetBSD: dwc2_hcdddma.c,v 1.6 2014/04/03 06:34:58 skrll Exp $ */
/*
memset(qh->desc_list, 0,
sizeof(struct dwc2_hcd_dma_desc) * dwc2_max_desc_num(qh));
- qh->n_bytes = malloc(sizeof(u32) * dwc2_max_desc_num(qh), M_DEVBUF,
+ qh->n_bytes = mallocarray(dwc2_max_desc_num(qh), sizeof(u32), M_DEVBUF,
M_ZERO | M_WAITOK);
return 0;