Print this page
5253 kmem_alloc/kmem_zalloc won't fail with KM_SLEEP
5254 getrbuf won't fail with KM_SLEEP

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/yge/yge.c
          +++ new/usr/src/uts/common/io/yge/yge.c
↓ open down ↓ 1007 lines elided ↑ open up ↑
1008 1008           * Allocate the interrupt.  Note that we only bother with a single
1009 1009           * interrupt.  One could argue that for MSI devices with dual ports,
1010 1010           * it would be nice to have a separate interrupt per port.  But right
1011 1011           * now I don't know how to configure that, so we'll just settle for
1012 1012           * a single interrupt.
1013 1013           */
1014 1014          dev->d_intrcnt = 1;
1015 1015  
1016 1016          dev->d_intrsize = count * sizeof (ddi_intr_handle_t);
1017 1017          dev->d_intrh = kmem_zalloc(dev->d_intrsize, KM_SLEEP);
1018      -        if (dev->d_intrh == NULL) {
1019      -                yge_error(dev, NULL, "Unable to allocate interrupt handle");
1020      -                return (DDI_FAILURE);
1021      -        }
1022 1018  
1023 1019          rv = ddi_intr_alloc(dip, dev->d_intrh, intr_type, 0, dev->d_intrcnt,
1024 1020              &actual, DDI_INTR_ALLOC_STRICT);
1025 1021          if ((rv != DDI_SUCCESS) || (actual == 0)) {
1026 1022                  yge_error(dev, NULL,
1027 1023                      "Unable to allocate interrupt, %d, count %d",
1028 1024                      rv, actual);
1029 1025                  kmem_free(dev->d_intrh, dev->d_intrsize);
1030 1026                  return (DDI_FAILURE);
1031 1027          }
↓ open down ↓ 2561 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX