]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[skel] Check for ioremap() failures
authorMichael Brown <mcb30@ipxe.org>
Wed, 16 Jul 2014 14:52:48 +0000 (15:52 +0100)
committerMichael Brown <mcb30@ipxe.org>
Wed, 16 Jul 2014 14:52:48 +0000 (15:52 +0100)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/drivers/net/skeleton.c

index e50b778a89ae381ae46185cc228ec95f70c4a465..365111b8d23619c5aa4a217c0b8f7df306135d43 100644 (file)
@@ -241,6 +241,10 @@ static int skeleton_probe ( struct pci_device *pci ) {
 
        /* Map registers */
        skel->regs = ioremap ( pci->membase, SKELETON_BAR_SIZE );
+       if ( ! skel->regs ) {
+               rc = -ENODEV;
+               goto err_ioremap;
+       }
 
        /* Reset the NIC */
        if ( ( rc = skeleton_reset ( skel ) ) != 0 )
@@ -269,6 +273,7 @@ static int skeleton_probe ( struct pci_device *pci ) {
        skeleton_reset ( skel );
  err_reset:
        iounmap ( skel->regs );
+ err_ioremap:
        netdev_nullify ( netdev );
        netdev_put ( netdev );
  err_alloc: