Skip to contentSkip to conversation

drivers/block/mtip32xx: remove the null check for debugfs_remove_recursive

PATCH Applied zhong jiang 2 participants 2 messages Aug 8, 2018 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/block/mtip32xx: remove the null check for debugfs_remove_recursive

debugfs_remove_recursive has taken null pointer into account. So it is safe to drop the null check before calling the funtion.

---
 drivers/block/mtip32xx/mtip32xx.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/block/mtip32xx/mtip32xx.c +1 -2
index 2b6d6bc..d0666f5c 100644
@@ -2574,8 +2574,7 @@ static int mtip_hw_debugfs_init(struct driver_data *dd)
 
 static void mtip_hw_debugfs_exit(struct driver_data *dd)
 {
-	if (dd->dfs_node)
-		debugfs_remove_recursive(dd->dfs_node);
+	debugfs_remove_recursive(dd->dfs_node);
 }
 
 /*
Signature · 1 line
1.7.12.4
maintainer Applied
#1 lore raw
Quoted 2 lines · zhong jiang

debugfs_remove_recursive has taken null pointer into account. So it is safe to drop the null check before calling the funtion.

Applied, thanks.

Signature · 1 line
Jens Axboe