Skip to content
Commit 3192c53e authored by Thomas Bogendoerfer's avatar Thomas Bogendoerfer Committed by Doug Ledford
Browse files

IB/rxe: don't crash, if allocation of crc algorithm failed



Following crash happens, if crc algorithm couldn't be allocated:

[ 1087.989072] rdma_rxe: loaded
[ 1097.855397] PCLMULQDQ-NI instructions are not detected.
[ 1097.901220] rdma_rxe: failed to allocate crc algorithmi err:-2
[ 1097.901248] BUG: unable to handle kernel
[ 1097.901249] NULL pointer dereference
[ 1097.901250]  at 0000000000000046
[...]

Reason is that rxe->tfm is assigned the error return, which will then
be used for crypto_free_shash() in rxe_cleanup. Fix by using a
temporary variable and assigning it rxe->tfm after allocation succeeded.

Fixes: cee2688e ("IB/rxe: Offload CRC calculation when possible")
Signed-off-by: default avatarThomas Bogendoerfer <tbogendoerfer@suse.de>
Reviewed-by: default avatarLeon Romanovsky <leonro@mellanox.com>
Acked-by: default avatarMoni Shoua <monis@mellanox.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 89548bca
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment