diff options
-rw-r--r-- | drivers/nvme/host/core.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index a2ab4e440bea..f837d666cbd4 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c | |||
@@ -2961,8 +2961,6 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid) | |||
2961 | 2961 | ||
2962 | static void nvme_ns_remove(struct nvme_ns *ns) | 2962 | static void nvme_ns_remove(struct nvme_ns *ns) |
2963 | { | 2963 | { |
2964 | struct nvme_ns_head *head = ns->head; | ||
2965 | |||
2966 | if (test_and_set_bit(NVME_NS_REMOVING, &ns->flags)) | 2964 | if (test_and_set_bit(NVME_NS_REMOVING, &ns->flags)) |
2967 | return; | 2965 | return; |
2968 | 2966 | ||
@@ -2980,15 +2978,14 @@ static void nvme_ns_remove(struct nvme_ns *ns) | |||
2980 | 2978 | ||
2981 | mutex_lock(&ns->ctrl->subsys->lock); | 2979 | mutex_lock(&ns->ctrl->subsys->lock); |
2982 | nvme_mpath_clear_current_path(ns); | 2980 | nvme_mpath_clear_current_path(ns); |
2983 | if (head) | 2981 | list_del_rcu(&ns->siblings); |
2984 | list_del_rcu(&ns->siblings); | ||
2985 | mutex_unlock(&ns->ctrl->subsys->lock); | 2982 | mutex_unlock(&ns->ctrl->subsys->lock); |
2986 | 2983 | ||
2987 | mutex_lock(&ns->ctrl->namespaces_mutex); | 2984 | mutex_lock(&ns->ctrl->namespaces_mutex); |
2988 | list_del_init(&ns->list); | 2985 | list_del_init(&ns->list); |
2989 | mutex_unlock(&ns->ctrl->namespaces_mutex); | 2986 | mutex_unlock(&ns->ctrl->namespaces_mutex); |
2990 | 2987 | ||
2991 | synchronize_srcu(&head->srcu); | 2988 | synchronize_srcu(&ns->head->srcu); |
2992 | nvme_put_ns(ns); | 2989 | nvme_put_ns(ns); |
2993 | } | 2990 | } |
2994 | 2991 | ||