BUG? usb ksdk 1.0.0 dev_get_xd response not checked

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

BUG? usb ksdk 1.0.0 dev_get_xd response not checked

Jump to solution
766 Views
csjc
Contributor II

see KSDK_1.0.0\usb\usb_core\device\sources\controller\usb_dev.c:

in usb_device_recv_data() and usb_device_send_data()

the call to get a transfer descriptor is intended to populate xd_ptr {which is dereferenced without check in usb_device_recv_data() and usb_device_send_data()}

example:

    if (((usb_dev_interface_functions_struct_t*)\

        usb_dev_ptr->usb_dev_interface)->dev_get_xd != NULL)

    {

        error = ((usb_dev_interface_functions_struct_t*)\

            usb_dev_ptr->usb_dev_interface)->dev_get_xd(usb_dev_ptr->controller_handle, &xd_ptr);   

    }

    else

    {

        #if _DEBUG

            printf("usb_device_send_data: DEV_GET_XD is NULL\n");

        #endif 

        return USBERR_ERROR;

    }

   

    OS_Mutex_lock(usb_dev_ptr->mutex);

    /* Initialize the new transfer descriptor */     

    xd_ptr->ep_num = ep_num;

    xd_ptr->bdirection = USB_SEND;

    xd_ptr->wtotallength = size;

    xd_ptr->wstartaddress = buff_ptr;

    xd_ptr->wsofar = 0;

    xd_ptr->bstatus = USB_STATUS_TRANSFER_ACCEPTED;

   

    if (((usb_dev_interface_functions_struct_t*)\

        usb_dev_ptr->usb_dev_interface)->dev_send != NULL)

    {

        error = ((usb_dev_interface_functions_struct_t*)\

            usb_dev_ptr->usb_dev_interface)->dev_send(usb_dev_ptr->controller_handle, xd_ptr);   

    }

Labels (2)
0 Kudos
1 Solution
538 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Chris:

This bug is already reported to our developers. It should be fixed in the next release of KSDK.

Thanks a lot for your feedback!


Regards!,
Jorge Gonzalez

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

View solution in original post

0 Kudos
3 Replies
539 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Chris:

This bug is already reported to our developers. It should be fixed in the next release of KSDK.

Thanks a lot for your feedback!


Regards!,
Jorge Gonzalez

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

0 Kudos
538 Views
csjc
Contributor II

is this information available anywhere? 

it is not listed in the available latest published KSDK errata: http://cache.freescale.com/files/soft_dev_tools/doc/support_info/KSDK100ER.zip?fasp=1&WT_TYPE=Errata...

0 Kudos
538 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hi Chris:

This bug was not detected before the publication of that errata document. I think there will be a new version of that document including this one.

Regards!

Jorge Gonzalez

0 Kudos