summaryrefslogtreecommitdiffstats
path: root/drivers/char/random.c
diff options
context:
space:
mode:
authorMaor Gottlieb <maorg@nvidia.com>2021-08-24 17:25:30 +0300
committerJason Gunthorpe <jgg@nvidia.com>2021-08-24 19:52:40 -0300
commit3e302dbc6774a27edaea39a1d5107f0c12e35cf2 (patch)
tree082ed97d3a748ff89836ba6a2d7954a16fb029c8 /drivers/char/random.c
parent90e7a6de62781c27d6a111fccfb19b807f9b6887 (diff)
downloadlinux-3e302dbc6774a27edaea39a1d5107f0c12e35cf2.tar.gz
linux-3e302dbc6774a27edaea39a1d5107f0c12e35cf2.tar.bz2
linux-3e302dbc6774a27edaea39a1d5107f0c12e35cf2.zip
lib/scatterlist: Fix wrong update of orig_nents
orig_nents should represent the number of entries with pages, but __sg_alloc_table_from_pages sets orig_nents as the number of total entries in the table. This is wrong when the API is used for dynamic allocation where not all the table entries are mapped with pages. It wasn't observed until now, since RDMA umem who uses this API in the dynamic form doesn't use orig_nents implicit or explicit by the scatterlist APIs. Fix it by changing the append API to track the SG append table state and have an API to free the append table according to the total number of entries in the table. Now all APIs set orig_nents as number of enries with pages. Fixes: 07da1223ec93 ("lib/scatterlist: Add support in dynamic allocation of SG table from pages") Link: https://lore.kernel.org/r/20210824142531.3877007-3-maorg@nvidia.com Signed-off-by: Maor Gottlieb <maorg@nvidia.com> Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/char/random.c')
0 files changed, 0 insertions, 0 deletions