Skip to content

Commit efd3de1

Browse files
authored
Merge pull request #243 from BerninaInternationalAG/add_nullptr_check
Added a check for NULL packet before using the pointer
2 parents f1bccd9 + 578d90a commit efd3de1

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)