Skip to content

Commit d18cb6c

Browse files
jfischer-nojhedberg
authored andcommitted
usb: host: usbh_ch9: add ASSERT for unresolved data stage conditions
Do not explicitly check buf parameter in usbh_req_setup() but add ASSERT to check unresolved data stage conditions. Signed-off-by: Johann Fischer <[email protected]>
1 parent dd43679 commit d18cb6c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

subsys/usb/host/usbh_ch9.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ int usbh_req_setup(struct usb_device *const udev,
6060

6161
memcpy(xfer->setup_pkt, &req, sizeof(req));
6262

63-
if (wLength && buf != NULL) {
63+
__ASSERT((buf != NULL && wLength) || (buf == NULL && !wLength),
64+
"Unresolved conditions for data stage");
65+
if (wLength) {
6466
ret = usbh_xfer_buf_add(udev, xfer, buf);
6567
if (ret) {
6668
goto buf_alloc_err;

0 commit comments

Comments
 (0)