Check against maxsegsz being zero in bus_dma_tag_create and return EINVAL
if it is. Reviewed by: scott long
This commit is contained in:
parent
9b434ede5c
commit
f2114f3bcd
@ -220,6 +220,10 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment,
|
||||
if (boundary != 0 && boundary < maxsegsz)
|
||||
maxsegsz = boundary;
|
||||
|
||||
if (maxsegsz == 0) {
|
||||
return (EINVAL);
|
||||
}
|
||||
|
||||
/* Return a NULL tag on failure */
|
||||
*dmat = NULL;
|
||||
|
||||
|
@ -225,6 +225,10 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment,
|
||||
if (boundary != 0 && boundary < maxsegsz)
|
||||
maxsegsz = boundary;
|
||||
|
||||
if (maxsegsz == 0) {
|
||||
return (EINVAL);
|
||||
}
|
||||
|
||||
/* Return a NULL tag on failure */
|
||||
*dmat = NULL;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user