Print this page
10090 rt2860_free_rx_ring doesn't need to check for NULL array

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/rwn/rt2860.c
          +++ new/usr/src/uts/common/io/rwn/rt2860.c
   1    1  /*
   2    2   * Copyright 2017 Gary Mills
   3    3   * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
   4    4   * Use is subject to license terms.
        5 + * Copyright (c) 2018, Joyent, Inc.
   5    6   */
   6    7  
   7    8  /*
   8    9   * Copyright (c) 2007, 2008
   9   10   *      Damien Bergamini <damien.bergamini@free.fr>
  10   11   *
  11   12   * Permission to use, copy, modify, and distribute this software for any
  12   13   * purpose with or without fee is hereby granted, provided that the above
  13   14   * copyright notice and this permission notice appear in all copies.
  14   15   *
↓ open down ↓ 878 lines elided ↑ open up ↑
 893  894  static void
 894  895  rt2860_free_rx_ring(struct rt2860_softc *sc, struct rt2860_rx_ring *ring)
 895  896  {
 896  897          struct rt2860_rx_data   *data;
 897  898          int                     i, count;
 898  899  
 899  900          if (ring->rxd != NULL)
 900  901                  rt2860_free_dma_mem(&ring->rxdesc_dma);
 901  902  
 902  903          count = RT2860_RX_RING_COUNT;
 903      -        if (ring->data != NULL) {
 904      -                for (i = 0; i < count; i++) {
 905      -                        data = &ring->data[i];
 906      -                        rt2860_free_dma_mem(&data->rxbuf_dma);
 907      -                }
      904 +
      905 +        for (i = 0; i < count; i++) {
      906 +                data = &ring->data[i];
      907 +                rt2860_free_dma_mem(&data->rxbuf_dma);
 908  908          }
 909  909  }
 910  910  
 911  911  static int
 912  912  rt2860_alloc_tx_pool(struct rt2860_softc *sc)
 913  913  {
 914  914          struct rt2860_tx_data   *data;
 915  915          int                     i, err, size;
 916  916  
 917  917          size = RT2860_TX_POOL_COUNT * sizeof (struct rt2860_txwi);
↓ open down ↓ 2279 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX