Print this page
10094 i_mdi_client_free() doesn't need to check for a NULL cdip

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/os/sunmdi.c
          +++ new/usr/src/uts/common/os/sunmdi.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  23   23   * Copyright (c) 2014 Nexenta Systems Inc. All rights reserved.
       24 + * Copyright (c) 2018, Joyent, Inc.
  24   25   */
  25   26  
  26   27  /*
  27   28   * Multipath driver interface (MDI) implementation; see mdi_impldefs.h for a
  28   29   * more detailed discussion of the overall mpxio architecture.
  29   30   *
  30   31   * Default locking order:
  31   32   *
  32   33   * _NOTE(LOCK_ORDER(mdi_mutex, mdi_vhci:vh_phci_mutex);
  33   34   * _NOTE(LOCK_ORDER(mdi_mutex, mdi_vhci:vh_client_mutex);
↓ open down ↓ 1437 lines elided ↑ open up ↑
1471 1472           */
1472 1473          kmem_free(ct->ct_drvname, strlen(ct->ct_drvname) + 1);
1473 1474          kmem_free(ct->ct_guid, strlen(ct->ct_guid) + 1);
1474 1475          kmem_free(ct->ct_lb_args, sizeof (client_lb_args_t));
1475 1476          cv_destroy(&ct->ct_failover_cv);
1476 1477          cv_destroy(&ct->ct_unstable_cv);
1477 1478          cv_destroy(&ct->ct_powerchange_cv);
1478 1479          mutex_destroy(&ct->ct_mutex);
1479 1480          kmem_free(ct, sizeof (*ct));
1480 1481  
1481      -        if (cdip != NULL) {
1482      -                MDI_VHCI_CLIENT_UNLOCK(vh);
1483      -                (void) i_mdi_devinfo_remove(vdip, cdip, flags);
1484      -                MDI_VHCI_CLIENT_LOCK(vh);
1485      -        }
     1482 +        MDI_VHCI_CLIENT_UNLOCK(vh);
     1483 +        (void) i_mdi_devinfo_remove(vdip, cdip, flags);
     1484 +        MDI_VHCI_CLIENT_LOCK(vh);
     1485 +
1486 1486          return (rv);
1487 1487  }
1488 1488  
1489 1489  /*
1490 1490   * i_mdi_client_find():
1491 1491   *              Find the client structure corresponding to a given guid
1492 1492   *              Caller should hold the vhci client lock.
1493 1493   */
1494 1494  static mdi_client_t *
1495 1495  i_mdi_client_find(mdi_vhci_t *vh, char *cname, char *guid)
↓ open down ↓ 8249 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX