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:
parent
cb18017c42
commit
a0ba9ce276
@ -579,6 +579,9 @@ associate_workers_with_ns(void)
|
|||||||
count = g_num_namespaces;
|
count = g_num_namespaces;
|
||||||
|
|
||||||
for (i = 0; i < count; i++) {
|
for (i = 0; i < count; i++) {
|
||||||
|
if (entry == NULL) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
ns_ctx = malloc(sizeof(struct ns_worker_ctx));
|
ns_ctx = malloc(sizeof(struct ns_worker_ctx));
|
||||||
if (!ns_ctx) {
|
if (!ns_ctx) {
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user