mirror of https://gitee.com/openkylin/linux.git
nvme-fabrics: Fix memory leaks in nvmf_parse_options()
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
This commit is contained in:
parent
76c08bf46a
commit
8eadfcb1b6
|
@ -666,10 +666,12 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts,
|
||||||
if (nqnlen >= NVMF_NQN_SIZE) {
|
if (nqnlen >= NVMF_NQN_SIZE) {
|
||||||
pr_err("%s needs to be < %d bytes\n",
|
pr_err("%s needs to be < %d bytes\n",
|
||||||
p, NVMF_NQN_SIZE);
|
p, NVMF_NQN_SIZE);
|
||||||
|
kfree(p);
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
opts->host = nvmf_host_add(p);
|
opts->host = nvmf_host_add(p);
|
||||||
|
kfree(p);
|
||||||
if (!opts->host) {
|
if (!opts->host) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto out;
|
goto out;
|
||||||
|
|
Loading…
Reference in New Issue