Fix assertion occurrence in rwb_invalidate_writebuffer()

This commit is contained in:
Satoshi Togawa 2020-01-25 20:37:41 +09:00 committed by patacongo
parent b46b76c956
commit aad1ab2574

View File

@ -428,7 +428,7 @@ int rwb_invalidate_writebuffer(FAR struct rwbuffer_s *rwb,
wrbend = rwb->wrblockstart + rwb->wrnblocks;
invend = startblock + blockcount;
if (rwb->wrblockstart > invend || wrbend < startblock)
if (wrbend <= startblock || rwb->wrblockstart >= invend)
{
ret = OK;
}
@ -1130,4 +1130,3 @@ int rwb_flush(FAR struct rwbuffer_s *rwb)
#endif
#endif /* CONFIG_DRVR_WRITEBUFFER || CONFIG_DRVR_READAHEAD */