mirror of
https://github.com/ipxe/ipxe.git
synced 2026-05-05 20:36:28 +02:00
[librm] Fail gracefully if asked to ioremap() a zero length
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
parent
36cffe054d
commit
d25e7daf47
@ -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 ) );
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user