diff options
author | Bart Van Assche <[email protected]> | 2021-05-23 21:12:08 -0700 |
---|---|---|
committer | Jason Gunthorpe <[email protected]> | 2021-05-28 20:21:20 -0300 |
commit | c838de1af141ee3bd23ea1781a7033375b54f35a (patch) | |
tree | 3b80b82f8b616d0fb622cb38c4b514dfd32c2188 /drivers/infiniband/ulp/srp/ib_srp.c | |
parent | 17bb6b6bb50734a9e9629f08af8e251b5756b460 (diff) |
RDMA/srp: Add more structure size checks
Before modifying how the __packed attribute is used, add compile time
size checks for the structures that will be modified.
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Leon Romanovsky <[email protected]>
Cc: Nicolas Morey-Chaisemartin <[email protected]>
Signed-off-by: Bart Van Assche <[email protected]>
Signed-off-by: Jason Gunthorpe <[email protected]>
Diffstat (limited to 'drivers/infiniband/ulp/srp/ib_srp.c')
-rw-r--r-- | drivers/infiniband/ulp/srp/ib_srp.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 31f8aa2c40ed..0f66bf015db6 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -4078,10 +4078,13 @@ static int __init srp_init_module(void) { int ret; + BUILD_BUG_ON(sizeof(struct srp_aer_req) != 36); + BUILD_BUG_ON(sizeof(struct srp_cmd) != 48); BUILD_BUG_ON(sizeof(struct srp_imm_buf) != 4); + BUILD_BUG_ON(sizeof(struct srp_indirect_buf) != 20); BUILD_BUG_ON(sizeof(struct srp_login_req) != 64); BUILD_BUG_ON(sizeof(struct srp_login_req_rdma) != 56); - BUILD_BUG_ON(sizeof(struct srp_cmd) != 48); + BUILD_BUG_ON(sizeof(struct srp_rsp) != 36); if (srp_sg_tablesize) { pr_warn("srp_sg_tablesize is deprecated, please use cmd_sg_entries\n"); |