Skip to contentSkip to conversation

ext4: missing unlock in ext4_clear_request_list()

PATCH In review Dan Carpenter 2 participants 2 messages Nov 17, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ext4: missing unlock in ext4_clear_request_list()

If the the li_request_list was empty then it returned with the lock held. Instead of adding a "goto unlock" I just removed that special case and let it go past the empty list_for_each_safe().

---
This is a static checker patch.

fs/ext4/super.c +0 -3
index 61182fe..ef09d14 100644
@@ -2799,9 +2799,6 @@ static void ext4_clear_request_list(void)
 	struct ext4_li_request *elr;
 
 	mutex_lock(&ext4_li_info->li_list_mtx);
-	if (list_empty(&ext4_li_info->li_request_list))
-		return;
-
 	list_for_each_safe(pos, n, &ext4_li_info->li_request_list) {
 		elr = list_entry(pos, struct ext4_li_request,
 				 lr_request);
maintainer
#1 lore raw
Quoted 5 lines · Dan Carpenter

If the the li_request_list was empty then it returned with the lock held. Instead of adding a "goto unlock" I just removed that special case and let it go past the empty list_for_each_safe().

Nice catch. Thanks, I've grabbed this and put it into the ext4 patch queue and will be pushing it to Linus ASAP.

- Ted