]> git.baikalelectronics.ru Git - kernel.git/commit
net: mlx5: Add a missing check on idr_find, free buf
authorAditya Pakki <pakki001@umn.edu>
Tue, 19 Mar 2019 21:42:40 +0000 (16:42 -0500)
committerSaeed Mahameed <saeedm@mellanox.com>
Fri, 29 Mar 2019 19:24:41 +0000 (12:24 -0700)
commit9f08c3e2db442e0699a43a5440130acf95e86e19
tree4105234bde7ecea83d628db37f946a12e32bb4e9
parent7e0529263eebd011bdf96aede8c628c0cfaa51de
net: mlx5: Add a missing check on idr_find, free buf

idr_find() can return a NULL value to 'flow' which is used without a
check. The patch adds a check to avoid potential NULL pointer dereference.

In case of mlx5_fpga_sbu_conn_sendmsg() failure, free buf allocated
using kzalloc.

Fixes: ec116bdf9a22 ("net/mlx5: Accel, add TLS rx offload routines")
Signed-off-by: Aditya Pakki <pakki001@umn.edu>
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/fpga/tls.c