nvmet: don't check for NULL pointer before kfree in nvmet_host_release
Subsystems (2)
Christoph Hellwig
maintainerPATCH 1/1 nvmet: don't check for NULL pointer before kfree in nvmet_host_release
And add an empty line after the variable declaration.
Reported-by kernel test robot <[email protected]>
Signed-off-by Christoph Hellwig <[email protected]>
--- drivers/nvme/target/configfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/nvme/target/configfs.c +2 -2
@@ -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); }
Signature · 1 line
2.30.2
Quoted 14 lines · Christoph Hellwig
And add an empty line after the variable declaration.
Reported-by kernel test robot <[email protected]>Signed-off-by Christoph Hellwig <[email protected]>--- drivers/nvme/target/configfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/nvme/target/configfs.c +0
-0@@ -1788,9 +1788,9 @@ static struct configfs_attribute *nvmet_host_attrs[] = {static void nvmet_host_release (struct config_item *item)
drivers/nvme/target/configfs.c static struct configfs_attribute *nvmet_host_attrs[] = { · line 1796
Quoted 10 lines
drivers/nvme/target/configfs.c +2
-2{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 <[email protected]>
Cheers,
Hannes
Quoted 5 lines · Christoph Hellwig
And add an empty line after the variable declaration.
Reported-by kernel test robot <[email protected]>Signed-off-by Christoph Hellwig <[email protected]>---
Looks good.
Reviewed-by Chaitanya Kulkarni <[email protected]>
-ck
Reviewed-by Sagi Grimberg <[email protected]>