[PATCH] nvmet: don't check for NULL pointer before kfree in nvmet_host_release

Hannes Reinecke hare at suse.de
Sun Jul 17 23:26:43 PDT 2022


On 7/18/22 07:01, Christoph Hellwig wrote:
> And add an empty line after the variable declaration.
> 
> Reported-by: kernel test robot <lkp at intel.com>
> Signed-off-by: Christoph Hellwig <hch at lst.de>
> ---
>   drivers/nvme/target/configfs.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/nvme/target/configfs.c b/drivers/nvme/target/configfs.c
> index 1b11f6a83bb6c..79ff382a5b145 100644
> --- a/drivers/nvme/target/configfs.c
> +++ b/drivers/nvme/target/configfs.c
> @@ -1788,9 +1788,9 @@ static struct configfs_attribute *nvmet_host_attrs[] = {
>   static void nvmet_host_release(struct config_item *item)
>   {
>   	struct nvmet_host *host = to_host(item);
> +
>   #ifdef CONFIG_NVME_TARGET_AUTH
> -	if (host->dhchap_secret)
> -		kfree(host->dhchap_secret);
> +	kfree(host->dhchap_secret);
>   #endif
>   	kfree(host);
>   }
Reviewed-by: Hannes Reinecke <hare at suse.de>

Cheers,

Hannes



More information about the Linux-nvme mailing list