Xilinx / embeddedsw

Xilinx Embedded Software (embeddedsw) Development
Other
929 stars 1.06k forks source link

Assert field before asserting NULL in IIC #145

Open raczben opened 3 years ago

raczben commented 3 years ago

There is a swapped assertion checking in iic.c in XIic_SetRecvHandler

void XIic_SetRecvHandler(XIic *InstancePtr, void *CallBackRef,
             XIic_Handler FuncPtr)
{
    Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);            <--- This should be the second
    Xil_AssertVoid(InstancePtr != NULL);                                       <--- This should be the first 
    Xil_AssertVoid(FuncPtr != NULL);
...
vsrik commented 3 years ago

Hi, Thanks. We will fix it in our next release.