[PATCH] nvmet: auth: Avoid sparse warning in nvmet_auth_sq_free()
Hannes Reinecke
hare at suse.de
Thu Apr 10 23:07:28 PDT 2025
On 4/11/25 03:00, Damien Le Moal wrote:
> When compiling with C=1, the following sparse warning is generated:
>
> auth.c:243:23: warning: Using plain integer as NULL pointer
>
> Avoid this warning by using NULL to instead of 0 to set the sq tls_key
> pointer.
>
> Fixes: fa2e0f8bbc68 ("nvmet-tcp: support secure channel concatenation")
> Signed-off-by: Damien Le Moal <dlemoal at kernel.org>
> ---
> drivers/nvme/target/auth.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/nvme/target/auth.c b/drivers/nvme/target/auth.c
> index 0b0645ac5df4..cef8d77f477b 100644
> --- a/drivers/nvme/target/auth.c
> +++ b/drivers/nvme/target/auth.c
> @@ -240,7 +240,7 @@ void nvmet_auth_sq_free(struct nvmet_sq *sq)
> {
> cancel_delayed_work(&sq->auth_expired_work);
> #ifdef CONFIG_NVME_TARGET_TCP_TLS
> - sq->tls_key = 0;
> + sq->tls_key = NULL;
> #endif
> kfree(sq->dhchap_c1);
> sq->dhchap_c1 = NULL;
Tsk. Did I do that?
Reviewed-by: Hannes Reinecke <hare at suse.de>
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare at suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
More information about the Linux-nvme
mailing list