Skip to content

Commit 578d90a

Browse files
committed
check for NULL packet before using the pointer
If the queue is empty we need the check here.
1 parent 515c9a4 commit 578d90a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

common/usbx_host_classes/src/ux_host_class_asix_thread.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,10 @@ USB_NETWORK_DEVICE_TYPE *ux_nx_device;
440440
current_packet = asix -> ux_host_class_asix_xmit_queue;
441441

442442
/* Get the next packet associated with the first packet. */
443-
next_packet = current_packet -> nx_packet_queue_next;
443+
if(current_packet != UX_NULL)
444+
next_packet = current_packet -> nx_packet_queue_next;
445+
else
446+
next_packet = UX_NULL;
444447

445448
/* Parse all these packets that were scheduled. */
446449
while (current_packet != UX_NULL)

0 commit comments

Comments
 (0)