History

nvme-auth: fix smatch warning complaints

When initializing auth context, there may be no secrets passed by the user. Make return code explicit when returning successfully. smatch warnings: drivers/nvme/host/auth.c:950 nvme_auth_init_ctrl() warn: missing error code? 'ret'

Sagi Grimberg committed 3 years ago

Commit 76807fc1 parent 6f99ac01 file · +1 −1Browse files

Unified · Split

drivers/nvme/host/auth.c+1−1
@@ -953,7 +953,7 @@ int nvme_auth_init_ctrl(struct nvme_ctrl *ctrl) · 952 unmodified lines
953 goto err_free_dhchap_secret;953 goto err_free_dhchap_secret;
954 954
955 if (!ctrl->opts->dhchap_secret && !ctrl->opts->dhchap_ctrl_secret)955 if (!ctrl->opts->dhchap_secret && !ctrl->opts->dhchap_ctrl_secret)
956 return ret;956 return 0;
957 957
958 ctrl->dhchap_ctxs = kvcalloc(ctrl_max_dhchaps(ctrl),958 ctrl->dhchap_ctxs = kvcalloc(ctrl_max_dhchaps(ctrl),
959 sizeof(*chap), GFP_KERNEL);959 sizeof(*chap), GFP_KERNEL);