nvmet: don't check for NULL pointer before kfree in nvmet_host_release
authorChristoph Hellwig <hch@lst.de>
Mon, 18 Jul 2022 05:00:12 +0000 (07:00 +0200)
committerJens Axboe <axboe@kernel.dk>
Tue, 2 Aug 2022 23:22:51 +0000 (17:22 -0600)
And add an empty line after the variable declaration.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/nvme/target/configfs.c

index e826a22f5e07e5f99204ec31b584d77d91b62805..2bcd60758919b433fa3eb14c5fb24df101965116 100644 (file)
@@ -1808,9 +1808,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);
 }