]> Git Repo - J-linux.git/commitdiff
nvme-auth: fix smatch warning complaints
authorSagi Grimberg <[email protected]>
Sun, 25 Dec 2022 11:28:51 +0000 (13:28 +0200)
committerChristoph Hellwig <[email protected]>
Wed, 28 Dec 2022 16:26:35 +0000 (06:26 -1000)
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'

Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Sagi Grimberg <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
drivers/nvme/host/auth.c

index bb0abbe4491cdc1283ce63f2ffed398bc2f069cf..4424f53a8a0a3d1a87b573b43c7d580e42fe1db3 100644 (file)
@@ -953,7 +953,7 @@ int nvme_auth_init_ctrl(struct nvme_ctrl *ctrl)
                goto err_free_dhchap_secret;
 
        if (!ctrl->opts->dhchap_secret && !ctrl->opts->dhchap_ctrl_secret)
-               return ret;
+               return 0;
 
        ctrl->dhchap_ctxs = kvcalloc(ctrl_max_dhchaps(ctrl),
                                sizeof(*chap), GFP_KERNEL);
This page took 0.046437 seconds and 4 git commands to generate.