]> git.baikalelectronics.ru Git - kernel.git/commit
RDMA/bnxt_re: Fix driver crash on unaligned PSN entry address
authorNaresh Kumar PBS <nareshkumar.pbs@broadcom.com>
Mon, 24 Aug 2020 18:14:36 +0000 (11:14 -0700)
committerJason Gunthorpe <jgg@nvidia.com>
Thu, 27 Aug 2020 12:30:44 +0000 (09:30 -0300)
commit8840c88079dae71dfab0f6d77a8309d7d33ce548
tree171ff412df06c6239e4faaa034fb6532194b3636
parentdc4eebe3c2005372ef0aedf6c390b5412fa2c9b3
RDMA/bnxt_re: Fix driver crash on unaligned PSN entry address

When computing the first psn entry, driver checks for page alignment. If
this address is not page aligned,it attempts to compute the offset in that
page for later use by using ALIGN macro. ALIGN macro does not return
offset bytes but the requested aligned address and hence cannot be used
directly to store as offset.  Since driver was using the address itself
instead of offset, it resulted in invalid address when filling the psn
buffer.

Fixed driver to use PAGE_MASK macro to calculate the offset.

Fixes: 2bc9f582d9ee ("RDMA/bnxt_re: Simplify obtaining queue entry from hw ring")
Link: https://lore.kernel.org/r/1598292876-26529-7-git-send-email-selvin.xavier@broadcom.com
Signed-off-by: Naresh Kumar PBS <nareshkumar.pbs@broadcom.com>
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/bnxt_re/qplib_fp.c