bug? - from khci_dev.c : usb_dci_khci_get_xd()

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

bug? - from khci_dev.c : usb_dci_khci_get_xd()

Jump to solution
983 Views
csjc
Contributor II

when there are no entries, the return path calls OS_Mutex_unlock instead of OS_Unlock() used in the success return path.

    /* This function can be called from any context, and it needs mutual

       exclusion with itself.*/

    OS_Lock();

   

    /* Get a transfer descriptor for the specified endpoint

     ** and direction

     */

    if (!usb_dev_ptr->xd_entries)

    {

        OS_Mutex_unlock(usb_dev_ptr->mutex);

        return USBERR_DEVICE_BUSY;

    }

Labels (1)
0 Kudos
1 Solution
736 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi Chris,

It is a known issue, the correct code should be:

    if (!usb_dev_ptr->xd_entries)

    {

        OS_Unlock();

        return USBERR_DEVICE_BUSY;

    }

The fixed code will be released at this December.

Thank you.


Wish it helps.
best regards
Ma Hui

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
3 Replies
736 Views
csjc
Contributor II

again this is from the ksdk usb 1.0.0 GA release code

0 Kudos
737 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi Chris,

It is a known issue, the correct code should be:

    if (!usb_dev_ptr->xd_entries)

    {

        OS_Unlock();

        return USBERR_DEVICE_BUSY;

    }

The fixed code will be released at this December.

Thank you.


Wish it helps.
best regards
Ma Hui

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
736 Views
csjc
Contributor II

It wasn't known to me.  Is there a public list?

This is the type of bug that can cause a significant amount of wasted debug time.  Please impress on the appropriate team that the errta needs be kept up to date.

0 Kudos