Page MenuHomeFreeBSD

linuxkpi: Correct nents passed to dma_{un,}map_sg_attrs
ClosedPublic

Authored by zishun.yi.dev_gmail.com on Jun 25 2026, 1:28 PM.
Referenced Files
F171009120: D57842.id180620.diff
Tue, Sep 8, 4:14 AM
Unknown Object (File)
Mon, Sep 7, 1:56 PM
Unknown Object (File)
Mon, Sep 7, 9:04 AM
Unknown Object (File)
Mon, Sep 7, 2:30 AM
Unknown Object (File)
Sun, Sep 6, 2:18 AM
Unknown Object (File)
Sat, Sep 5, 1:47 AM
Unknown Object (File)
Fri, Sep 4, 11:39 PM
Unknown Object (File)
Fri, Sep 4, 6:45 PM

Details

Summary

In linux docs, there is:

void
dma_unmap_sg(struct device *dev, struct scatterlist *sg,
             int nents, enum dma_data_direction direction)
Note: <nents> must be the number you passed in, not the number of DMA
address entries returned.

but I think currently nents is equal to orig_nents in linuxkpi. So It's
just a trivial fix.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable