Modify the null pointer fifo to access first and then judge
This commit is contained in:
@@ -98,10 +98,10 @@ unsigned int salof_fifo_read(salof_fifo_t fifo, void *buff, unsigned int len, un
|
|||||||
{
|
{
|
||||||
int l;
|
int l;
|
||||||
|
|
||||||
salof_sem_pend(fifo->sem, timeout);
|
|
||||||
|
|
||||||
if((!fifo) || (!buff) || (!len))
|
if((!fifo) || (!buff) || (!len))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
salof_sem_pend(fifo->sem, timeout);
|
||||||
|
|
||||||
len = FIFO_MIN(len, fifo->in - fifo->out);
|
len = FIFO_MIN(len, fifo->in - fifo->out);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user