Re: [PATCH] regmap: debugfs: Fix a reversed if statement in regmap_debugfs_init()

2021-01-05 Thread Mark Brown
On Tue, 5 Jan 2021 14:42:29 +0300, Dan Carpenter wrote: > This code will leak "map->debugfs_name" because the if statement is > reversed so it only frees NULL pointers instead of non-NULL. In > fact the if statement is not required and should just be removed > because kfree() accepts NULL pointers

[PATCH] regmap: debugfs: Fix a reversed if statement in regmap_debugfs_init()

2021-01-05 Thread Dan Carpenter
This code will leak "map->debugfs_name" because the if statement is reversed so it only frees NULL pointers instead of non-NULL. In fact the if statement is not required and should just be removed because kfree() accepts NULL pointers. Fixes: cffa4b2122f5 ("regmap: debugfs: Fix a memory leak when