Who frees extra memory from usb_attach() ?


I’m working on a USB class driver. I have the usbd_attach() function allocate the memory for my device extension structure, as recommended in the USB DDK guide.

Question is: Who frees that memory when the device gets removed? Do I have to do it myself or does the corresponding usbd_detach() call do it? Since USB devices may be inserted and removed many times during the life of the driver process, I see great potential for memory leaks here, and the QNX documentation doesn’t state who’s responsible for the extra memory.

I posted this question already in QNX Users / QNX6 OS, but no one answered, perhaps it was the wrong place to ask.

Best regards,