projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
543c09c
)
nvme: check return value of init_srcu_struct function
author
Max Gurtovoy
<
[email protected]
>
Thu, 12 Apr 2018 15:16:12 +0000
(09:16 -0600)
committer
Jens Axboe
<
[email protected]
>
Thu, 12 Apr 2018 15:58:27 +0000
(09:58 -0600)
Also add error flow in case srcu initialization function fails.
Signed-off-by: Max Gurtovoy <
[email protected]
>
Reviewed-by: Christoph Hellwig <
[email protected]
>
Signed-off-by: Keith Busch <
[email protected]
>
Signed-off-by: Jens Axboe <
[email protected]
>
drivers/nvme/host/core.c
patch
|
blob
|
history
diff --git
a/drivers/nvme/host/core.c
b/drivers/nvme/host/core.c
index 695e52ae22fdef69f6d5af253781021f07aeae2e..b09940c556d05b57d21b323be68fbd39bd16aa5b 100644
(file)
--- a/
drivers/nvme/host/core.c
+++ b/
drivers/nvme/host/core.c
@@
-2832,7
+2832,9
@@
static struct nvme_ns_head *nvme_alloc_ns_head(struct nvme_ctrl *ctrl,
goto out_free_head;
head->instance = ret;
INIT_LIST_HEAD(&head->list);
- init_srcu_struct(&head->srcu);
+ ret = init_srcu_struct(&head->srcu);
+ if (ret)
+ goto out_ida_remove;
head->subsys = ctrl->subsys;
head->ns_id = nsid;
kref_init(&head->ref);
@@
-2854,6
+2856,7
@@
static struct nvme_ns_head *nvme_alloc_ns_head(struct nvme_ctrl *ctrl,
return head;
out_cleanup_srcu:
cleanup_srcu_struct(&head->srcu);
+out_ida_remove:
ida_simple_remove(&ctrl->subsys->ns_ida, head->instance);
out_free_head:
kfree(head);