Project

General

Profile

Actions

Bug #696

closed

Incorrect check dma_attr_sgllen <= 0 in rootnex_valid_alloc_parms

Added by Yuri Pankov over 10 years ago. Updated over 10 years ago.

Status:
Resolved
Priority:
Normal
Category:
kernel
Start date:
2011-02-05
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

The check in question:

/*
 * rootnex_valid_alloc_parms()
 *    Called in ddi_dma_alloc_handle path to validate its parameters.
 */
static int
rootnex_valid_alloc_parms(ddi_dma_attr_t *attr, uint_t maxsegmentsize)
...
        if ((attr->dma_attr_seg & MMU_PAGEOFFSET) != MMU_PAGEOFFSET ||
            MMU_PAGESIZE & (attr->dma_attr_granular - 1) ||
==>         attr->dma_attr_sgllen <= 0) {          <===
                return (DDI_DMA_BADATTR);
        }
...

dmi_dma_attr(9S) does specify values < 0 as correct, so the check looks incorrect, breaking vmxnet3 driver when DEBUG is defined, at least.

The fix is to to remove the check or make it == 0 (0 is reserved, per manpage).

Actions

Also available in: Atom PDF