Stm32_can error when using

We are attempting to use the boards/px4/fmu-v5x/can.c. We call the can_devinit() for “/dev/can1” (we changed the can0 to can1 in the can_devinit function) and it returns with OK. Later in our module’s constructor we call open("/dev/can1", O_RDRW), get a valid file descriptor back (3); but, the write() later in the returns with a -1 and errno set to 9 (BADFD). If we remove the open() from the constructor and execute the sequence, open(), write(), close() on each use, everything works.

Has anyone seen this type of behavior ?