mirror of https://gitee.com/openkylin/linux.git
nvme: release namespace head reference on error
If a namespace identification does not match the subsystem's head for that NSID, release the reference that was taken when the matching head was initially found. Signed-off-by: Keith Busch <kbusch@kernel.org> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
d567572906
commit
ac262508da
|
@ -3503,6 +3503,7 @@ static int nvme_init_ns_head(struct nvme_ns *ns, unsigned nsid,
|
|||
"IDs don't match for shared namespace %d\n",
|
||||
nsid);
|
||||
ret = -EINVAL;
|
||||
nvme_put_ns_head(head);
|
||||
goto out_unlock;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue