At the moment in the usb exchange ca8210_io_worker messages are popped from the private out queue and the (what should be constant) local pDeviceRef is given as the pDeviceRef out param. In practice this should always just be reassigned with the same reference but that condition is not checked. Maybe it would be a good idea to add a second variable for checking and leave the local pDeviceRef constant?
At the moment in the usb exchange ca8210_io_worker messages are popped from the private out queue and the (what should be constant) local pDeviceRef is given as the pDeviceRef out param. In practice this should always just be reassigned with the same reference but that condition is not checked. Maybe it would be a good idea to add a second variable for checking and leave the local pDeviceRef constant?
line in question: https://github.com/Cascoda/ca821x-posix/blob/5af1bd184d0f714915f6102672bb5c1a31dc88b4/usb-exchange/usb_exchange.c#L326