]> git.baikalelectronics.ru Git - kernel.git/commit
qed: sanitize PBL chains allocation
authorAlexander Lobakin <alobakin@marvell.com>
Wed, 22 Jul 2020 22:10:35 +0000 (01:10 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 23 Jul 2020 01:19:03 +0000 (18:19 -0700)
commit6057ee25fb997c9883618d56c6f4e551ac2f160d
tree08bd8489f541676ab787ef9249beb2a925da2e7e
parentab424f6f8b4afa910bdd36585d8255ac35d56cbe
qed: sanitize PBL chains allocation

PBL chain elements are actually DMA addresses stored in __le64, but
currently their size is hardcoded to 8, and DMA addresses are assigned
via cast to variable-sized dma_addr_t without any bitwise conversions.
Change the type of pbl_virt array to match the actual one, add a new
field to store the size of allocated DMA memory and sanitize elements
assignment.

Misc: give more logic names to the members of qed_chain::pbl_sp embedded
struct.

Signed-off-by: Alexander Lobakin <alobakin@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
Signed-off-by: Michal Kalderon <michal.kalderon@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qed/qed_chain.c
drivers/net/ethernet/qlogic/qed/qed_sp_commands.c
include/linux/qed/qed_chain.h