david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

[librm] Fail gracefully if asked to ioremap() a zero length

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown 2017-03-21 14:17:18 +02:00
parent 36cffe054d
commit d25e7daf47
1 changed files with 2 additions and 1 deletions

View File

@ -197,7 +197,8 @@ static void * ioremap_pages ( unsigned long bus_addr, size_t len ) {
DBGC ( &io_pages, "IO mapping %08lx+%zx\n", bus_addr, len );
/* Sanity check */
assert ( len != 0 );
if ( ! len )
return NULL;
/* Round down start address to a page boundary */
start = ( bus_addr & ~( IO_PAGE_SIZE - 1 ) );