Skip to contentSkip to conversation

PM: Remove unbalanced mutex_unlock() from dpm_resume()

PATCH Applied Rafael J. Wysocki 3 participants 3 messages Feb 20, 2008

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

PATCH 1/1 PM: Remove unbalanced mutex_unlock() from dpm_resume()

Hi Greg,

Please consider taking the following fix for 2.6.25.

Thanks,
Rafael

---
From: Rafael J. Wysocki <[email protected]>

Remove an unnecessary unlocking of dpm_list_mtx in the error path in drivers/base/power/main.c:dpm_suspend() .

---
 drivers/base/power/main.c |    1 -
 1 file changed, 1 deletion(-)
drivers/base/power/main.c +0 -1
Index: linux-2.6/drivers/base/power/main.c
===================================================================
@@ -479,7 +479,6 @@ static int dpm_suspend(pm_message_t stat
 			mutex_lock(&dpm_list_mtx);
 			if (list_empty(&dev->power.entry))
 				list_add(&dev->power.entry, &dpm_locked);
-			mutex_unlock(&dpm_list_mtx);
 			break;
 		}
 		mutex_lock(&dpm_list_mtx);
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · Rafael J. Wysocki

Hi Greg,

Please consider taking the following fix for 2.6.25.

Don't just consider it! :-) It's a real bug fix.

Quoted 19 lines

Thanks,
Rafael

---
From: Rafael J. Wysocki <[email protected]>

Remove an unnecessary unlocking of dpm_list_mtx in the error path in drivers/base/power/main.c:dpm_suspend() .

---
 drivers/base/power/main.c |    1 -
 1 file changed, 1 deletion(-)

Index: linux-2.6/drivers/base/power/main.c
===================================================================

drivers/base/power/main.c static int dpm_suspend(pm_message_t stat · line 484

Quoted 7 lines
drivers/base/power/main.c +0 -1
@@ -479,7 +479,6 @@ static int dpm_suspend(pm_message_t stat
 			mutex_lock(&dpm_list_mtx);
 			if (list_empty(&dev->power.entry))
 				list_add(&dev->power.entry, &dpm_locked);
-			mutex_unlock(&dpm_list_mtx);
 			break;
 		}
 		mutex_lock(&dpm_list_mtx);
#2 lore raw

patch pm-remove-unbalanced-mutex_unlock-from-dpm_resume.patch added to gregkh-2.6 tree

In reply to Rafael J. Wysocki

This is a note to let you know that I've just added the patch titled

Subject: PM: Remove unbalanced mutex_unlock() from dpm_resume()

to my gregkh-2.6 tree. Its filename is

pm-remove-unbalanced-mutex_unlock-from-dpm_resume.patch

This tree can be found at
http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/

Quoted 1 line

From [email protected] Wed Feb 20 12:56:19 2008

From: "Rafael J. Wysocki" <[email protected]>
Date: Wed, 20 Feb 2008 02:01:41 +0100
Subject: PM: Remove unbalanced mutex_unlock() from dpm_resume()
To: Greg KH <[email protected]>
Cc: ACPI Devel Maling List <[email protected]>, Alan Stern <[email protected]>, Len Brown <[email protected]>, "Linux-pm mailing list" <[email protected]>, LKML <[email protected]>, Pavel Machek <[email protected]>
Message-ID: <[email protected]>
Content-Disposition: inline

From: Rafael J. Wysocki <[email protected]>

Remove an unnecessary unlocking of dpm_list_mtx in the error path in drivers/base/power/main.c:dpm_suspend() .

---
 drivers/base/power/main.c |    1 -
 1 file changed, 1 deletion(-)
drivers/base/power/main.c +0 -1
@@ -479,7 +479,6 @@ static int dpm_suspend(pm_message_t stat
 			mutex_lock(&dpm_list_mtx);
 			if (list_empty(&dev->power.entry))
 				list_add(&dev->power.entry, &dpm_locked);
-			mutex_unlock(&dpm_list_mtx);
 			break;
 		}
 		mutex_lock(&dpm_list_mtx);

Patches currently in gregkh-2.6 which might be from [email protected] are

driver/driver-core-pm-make-suspend_device-static.patch driver/pm-remove-unbalanced-mutex_unlock-from-dpm_resume.patch