Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[librm] Fail gracefully if asked to ioremap() a zero length
Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
mcb30 committed Mar 21, 2017
1 parent 36cffe0 commit d25e7da
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/arch/x86/transitions/librm_mgmt.c
Expand Up @@ -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 ) );
Expand Down

0 comments on commit d25e7da

Please sign in to comment.