]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
RDMA/hns: Remove the duplicate calls to ib_copy_validate_udata_in()
authorJason Gunthorpe <jgg@nvidia.com>
Wed, 25 Mar 2026 21:27:02 +0000 (18:27 -0300)
committerLeon Romanovsky <leonro@nvidia.com>
Tue, 31 Mar 2026 07:18:16 +0000 (03:18 -0400)
commitfdcbddcd3aa13c05ac99fe1de2d5d9eeb1af0c49
tree481250b8b75835532c0366411f76b75ee5a887b0
parent8e3e07cca00434d6430e44c310b2ab2965dfb794
RDMA/hns: Remove the duplicate calls to ib_copy_validate_udata_in()

A udata should be read only once per ioctl, not multiple times.
Multiple reads make it unclear what the content is since userspace can
change it between the reads.

Lift the ib_copy_validate_udata_in() out of
alloc_srq_buf()/alloc_srq_db() and into hns_roce_create_srq().

Found by AI.

Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
drivers/infiniband/hw/hns/hns_roce_srq.c