mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
nvme: don't free uuid pointer before printing it
Commitdf351ef737("nvme-fabrics: fix memory leak when parsing host ID option") fixed the leak of 'p' but in case uuid_parse() fails the memory is freed before the error print that is using it. Free it after printing eventual errors. Signed-off-by: Johannes Thumshirn <[email protected]> Fixes:df351ef737("nvme-fabrics: fix memory leak when parsing host ID option") Reported-by: Dan Carpenter <[email protected]> Reviewed-by: Max Gurtovoy <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
This commit is contained in:
parent
ee9aebb27c
commit
6e49412016
1 changed files with 2 additions and 1 deletions
|
|
@ -739,12 +739,13 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts,
|
|||
goto out;
|
||||
}
|
||||
ret = uuid_parse(p, &hostid);
|
||||
kfree(p);
|
||||
if (ret) {
|
||||
pr_err("Invalid hostid %s\n", p);
|
||||
ret = -EINVAL;
|
||||
kfree(p);
|
||||
goto out;
|
||||
}
|
||||
kfree(p);
|
||||
break;
|
||||
case NVMF_OPT_DUP_CONNECT:
|
||||
opts->duplicate_connect = true;
|
||||
|
|
|
|||
Loading…
Reference in a new issue