From: Hannes Reinecke Date: Wed, 24 Aug 2022 07:23:16 +0000 (+0200) Subject: nvmet-auth: add missing goto in nvmet_setup_auth() X-Git-Tag: v6.6.17~6560^2~9^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=da0342a3aa0357795224e6283df86444e1117168;p=platform%2Fkernel%2Flinux-rpi.git nvmet-auth: add missing goto in nvmet_setup_auth() There's a goto missing in nvmet_setup_auth(), causing a kernel oops when nvme_auth_extract_key() fails. Reported-by: Tal Lossos Signed-off-by: Hannes Reinecke Reviewed-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig --- diff --git a/drivers/nvme/target/auth.c b/drivers/nvme/target/auth.c index cf690df..c4113b4 100644 --- a/drivers/nvme/target/auth.c +++ b/drivers/nvme/target/auth.c @@ -196,6 +196,7 @@ int nvmet_setup_auth(struct nvmet_ctrl *ctrl) if (IS_ERR(ctrl->ctrl_key)) { ret = PTR_ERR(ctrl->ctrl_key); ctrl->ctrl_key = NULL; + goto out_free_hash; } pr_debug("%s: using ctrl hash %s key %*ph\n", __func__, ctrl->ctrl_key->hash > 0 ?