Skip to content

Commit d516933

Browse files
maurizio-lombardidwsuse
authored andcommitted
fabrics: fix a check-after-dereference error in nvmf_discovery_log()
logp pointer can't be NULL, because it has already been dereferenced, the function should check *logp instead. Signed-off-by: Maurizio Lombardi <[email protected]>
1 parent 850c3f1 commit d516933

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/nvme/fabrics.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ int nvmf_get_discovery_log(nvme_ctrl_t c, struct nvmf_discovery_log **logp,
894894
.ot = false,
895895
};
896896
*logp = nvme_discovery_log(c, &args, max_retries);
897-
return logp ? 0 : -1;
897+
return *logp ? 0 : -1;
898898
}
899899

900900
struct nvmf_discovery_log *nvmf_get_discovery_wargs(struct nvme_get_discovery_args *args)

0 commit comments

Comments
 (0)