Skip to content
Commit cac2a301 authored by Dan Carpenter's avatar Dan Carpenter Committed by Jason Gunthorpe
Browse files

RDMA/uverbs: check for allocation failure in uapi_add_elm()



If the kzalloc() fails then we should return ERR_PTR(-ENOMEM).  In the
current code it's possible that the kzalloc() fails and the
radix_tree_insert() inserts the NULL pointer successfully and we return
the NULL "elm" pointer to the caller.  That results in a NULL pointer
dereference.

Fixes: 9ed3e5f4 ("IB/uverbs: Build the specs into a radix tree at runtime")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent 6fe1a9b9
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