nvme/reset: don't crash if no namespaces are usable

Change-Id: I79b03c97f09125070dbdb1abe49db4a338f6a27f
Signed-off-by: Liang Yan <liangx.yan@intel.com>
This commit is contained in:
Liang Yan 2016-01-06 14:51:14 +08:00 committed by Daniel Verkamp
parent cb18017c42
commit a0ba9ce276

View File

@ -579,6 +579,9 @@ associate_workers_with_ns(void)
count = g_num_namespaces;
for (i = 0; i < count; i++) {
if (entry == NULL) {
break;
}
ns_ctx = malloc(sizeof(struct ns_worker_ctx));
if (!ns_ctx) {
return -1;