Commit d64bf89a authored by Dotan Barak's avatar Dotan Barak Committed by David S. Miller
Browse files

net/rds: Fix error handling in rds_ib_add_one()

rds_ibdev:ipaddr_list and rds_ibdev:conn_list are initialized
after allocation some resources such as protection domain.
If allocation of such resources fail, then these uninitialized
variables are accessed in rds_ib_dev_free() in failure path. This
can potentially crash the system. The code has been updated to
initialize these variables very early in the function.

Signed-off-by: default avatarDotan Barak <>
Signed-off-by: default avatarSudhakar Dindukurti <>
Acked-by: default avatarSantosh Shilimkar <>
Signed-off-by: default avatarDavid S. Miller <>
parent e8521e53
......@@ -143,6 +143,9 @@ static void rds_ib_add_one(struct ib_device *device)
refcount_set(&rds_ibdev->refcount, 1);
INIT_WORK(&rds_ibdev->free_work, rds_ib_dev_free);
rds_ibdev->max_wrs = device->attrs.max_qp_wr;
rds_ibdev->max_sge = min(device->attrs.max_send_sge, RDS_IB_MAX_SGE);
......@@ -203,9 +206,6 @@ static void rds_ib_add_one(struct ib_device *device)
rds_ibdev->use_fastreg ? "FRMR" : "FMR");
list_add_tail_rcu(&rds_ibdev->list, &rds_ib_devices);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment