From 9d0271c815d39a19c180bcc2db214769552d468d Mon Sep 17 00:00:00 2001 From: Jacek Kalwas Date: Thu, 25 Jul 2019 20:23:13 +0200 Subject: [PATCH] nvmf/rdma: fix missing return statement In case of failure during resource allocation within poll_group_create there is a lack of return statement which could lead to NULL ptr dereference. Signed-off-by: Jacek Kalwas Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/463195 (master) (cherry picked from commit db0c7f6a4f0256e868ee5d7ef72ef93f1cb522c4) Change-Id: I84abe64a1843117d76b97e62656bdfc4fe2b35d8 Signed-off-by: Tomasz Zawadzki Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/467127 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Reviewed-by: Ben Walker --- lib/nvmf/rdma.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/nvmf/rdma.c b/lib/nvmf/rdma.c index 904dcf5f7..509f70bbd 100644 --- a/lib/nvmf/rdma.c +++ b/lib/nvmf/rdma.c @@ -3052,6 +3052,7 @@ spdk_nvmf_rdma_poll_group_create(struct spdk_nvmf_transport *transport) SPDK_ERRLOG("Unable to allocate resources for shared receive queue.\n"); spdk_nvmf_rdma_poll_group_destroy(&rgroup->group); pthread_mutex_unlock(&rtransport->lock); + return NULL; } }