Fix all the bugs
- Mem leaks - Stack corruption - Div by 0 - Double frees
This commit is contained in:
@@ -336,7 +336,8 @@ static int _clock_sdmmc_config_clock_source_inner(u32 *pout, u32 id, u32 val)
|
||||
divisor = 2;
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
*pout = 24728;
|
||||
divisor = 31;
|
||||
}
|
||||
|
||||
_clock_sdmmc_table[2 * id] = val;
|
||||
|
||||
@@ -129,7 +129,7 @@ int i2c_send_byte(u32 idx, u32 x, u32 y, u8 b)
|
||||
|
||||
u8 i2c_recv_byte(u32 idx, u32 x, u32 y)
|
||||
{
|
||||
u8 tmp;
|
||||
u8 tmp = 0;
|
||||
i2c_recv_buf_small(&tmp, 1, idx, x, y);
|
||||
return tmp;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user