From 09c9fa11acb5ed051c6269cf51ffe99b5eb9fe67 Mon Sep 17 00:00:00 2001 From: Changcheng Liu Date: Thu, 25 Apr 2019 13:02:29 +0800 Subject: [PATCH] msg/async/rdma: check allocated memory immediately before using it The new "allocation functions" will through exception if it failes to allocate space. There's no need to assert(devices) here for every get_device operation. Refer to: https://en.cppreference.com/w/cpp/memory/new/bad_alloc Signed-off-by: Changcheng Liu --- src/msg/async/rdma/Infiniband.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/msg/async/rdma/Infiniband.h b/src/msg/async/rdma/Infiniband.h index d904ad7d11b..76122300376 100644 --- a/src/msg/async/rdma/Infiniband.h +++ b/src/msg/async/rdma/Infiniband.h @@ -121,7 +121,6 @@ class DeviceList { } Device* get_device(const char* device_name) { - ceph_assert(devices); for (int i = 0; i < num; ++i) { if (!strlen(device_name) || !strcmp(device_name, devices[i]->get_name())) { return devices[i]; -- 2.47.3