Cascoda / ca821x-posix

Library for posix systems to connect the ca821x-api to an available interface (usb/kernel driver)
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Check pDeviceRef out param in io_worker #5

Open HarryMorris opened 7 years ago

HarryMorris commented 7 years ago

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