]> git.karo-electronics.de Git - karo-tx-linux.git/commit
RDMA/bnxt_re: Do not free the ctx_tbl entry if delete GID fails
authorSelvin Xavier <selvin.xavier@broadcom.com>
Thu, 29 Jun 2017 19:28:11 +0000 (12:28 -0700)
committerDoug Ledford <dledford@redhat.com>
Thu, 20 Jul 2017 15:20:50 +0000 (11:20 -0400)
commit4a62c5e9e2e1c15ceb1654715d9284d97f921119
treeddb0c7c04a3170a048d54458007ff65a6a7cbeda
parentab69d4c8da38024191f3514c1296e9e8deea4e98
RDMA/bnxt_re: Do not free the ctx_tbl entry if delete GID fails

This fix is added only to avoid system crash in some a
specific scenario. When bnxt_re driver is loaded and if
user tries to change interface mac address, delete GID
fails because QP1 is still associated with existing MAC
(default GID). If the above command fails GID tables are
not modified in the h/w or driver, but the GID context memory
is freed. Now, if the user changes the mac back to the original
value, another add_gid comes to the driver where the driver
reports that the GID is already present in its table
and tries to access the context which was already freed.

So, in this case, in order to  avoid NULL pointer de-reference,
this patch removes the context memory free  if delete_gid fails
and the same context memory is re-used in new add_gid.
Memory cleanup will be taken care during driver unload, while
deleting the GID table.

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/bnxt_re/ib_verbs.c