Skip to contentSkip to conversation

objtool, perf: fix ifnullfree.cocci warnings

PATCH New Julia Lawall 1 participant 1 message Jan 10, 2020 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 objtool, perf: fix ifnullfree.cocci warnings

From: kbuild test robot <[email protected]>

NULL check before some freeing functions is not needed.

Generated by: scripts/coccinelle/free/ifnullfree.cocci

Fixes 4864b0702653 ("objtool, perf: Fix GCC 8 -Wrestrict error")
CC Josh Poimboeuf <[email protected]>

---

tree:   https://android.googlesource.com/kernel/common android-4.9-o-mr1
head:   58ce54880a03d9c27327434ba15281f5a7139671
commit: 4864b070265301ba88506ee407d51e058dcb0ad6 [42/51] objtool, perf: Fix GCC 8 -Wrestrict error

:::::: branch date: 29 hours ago
:::::: commit date: 9 weeks ago

Please take the patch only if it's a positive warning. Thanks!

 elevator.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
block/elevator.c +1 -2
@@ -846,8 +846,7 @@ int elv_register(struct elevator_type *e
 	spin_lock(&elv_list_lock);
 	if (elevator_find(e->elevator_name)) {
 		spin_unlock(&elv_list_lock);
-		if (e->icq_cache)
-			kmem_cache_destroy(e->icq_cache);
+		kmem_cache_destroy(e->icq_cache);
 		return -EBUSY;
 	}
 	list_add_tail(&e->list, &elv_list);