Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Step:15-SP4
nvme-cli.26590
0015-fabrics-fix-nvme-discover-segfault-if-sysf...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0015-fabrics-fix-nvme-discover-segfault-if-sysfs-path-is-.patch of Package nvme-cli.26590
From: Martin George <marting@netapp.com> Date: Sat, 30 Oct 2021 15:13:22 +0530 Subject: fabrics: fix 'nvme discover' segfault if sysfs path is not available References: bsc#1191935 Git-commit: 1490c6a86ca8363f3d12a06298e47dbb5a539b70 Avoid dereferencing connect_args strings if the corresponding nvme sysfs paths are not available. Signed-off-by: Martin George <marting@netapp.com> --- fabrics.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) --- a/fabrics.c +++ b/fabrics.c @@ -306,13 +306,14 @@ static bool ctrl_matches_connectargs(cha return found; addr = nvme_get_ctrl_attr(path, "address"); - if (!addr) { + cargs.subsysnqn = nvme_get_ctrl_attr(path, "subsysnqn"); + cargs.transport = nvme_get_ctrl_attr(path, "transport"); + + if (!addr || !cargs.subsysnqn || !cargs.transport) { fprintf(stderr, "nvme_get_ctrl_attr failed\n"); - return found; + goto out; } - cargs.subsysnqn = nvme_get_ctrl_attr(path, "subsysnqn"); - cargs.transport = nvme_get_ctrl_attr(path, "transport"); cargs.traddr = parse_conn_arg(addr, ' ', conarg_traddr); cargs.trsvcid = parse_conn_arg(addr, ' ', conarg_trsvcid); cargs.host_traddr = parse_conn_arg(addr, ' ', conarg_host_traddr); @@ -350,6 +351,7 @@ static bool ctrl_matches_connectargs(cha !strcmp(args->host_traddr, "none"))) found = true; +out: free(cargs.subsysnqn); free(cargs.transport); free(cargs.traddr);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor