Print this page
10087 atge_attach() doesn't need to check for kmem_zalloc() success

@@ -21,10 +21,12 @@
 
 /*
  * Copyright (c) 2012 Gary Mills
  *
  * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Copyright (c) 2018, Joyent, Inc.
  */
 /*
  * Copyright (c) 2009, Pyun YongHyeon <yongari@FreeBSD.org>
  * All rights reserved.
  *

@@ -1350,13 +1352,11 @@
 fail3:
         ddi_regs_map_free(&atgep->atge_io_handle);
 fail2:
         pci_config_teardown(&atgep->atge_conf_handle);
 fail1:
-        if (atgep)
                 kmem_free(atgep, sizeof (atge_t));
-
         return (DDI_FAILURE);
 }
 
 static int
 atge_detach(dev_info_t *dip, ddi_detach_cmd_t cmd)