Re: [PATCH] firmware: avoiding multiple replication for same firmware file

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andrew Morton <akpm@...>
Cc: <linux-kernel@...>, <dwmw2@...>
Date: Wednesday, August 6, 2008 - 5:46 am

Sorry, minor correction.

On Wed, 2008-08-06 at 15:05 +0530, Jaswinder Singh wrote:

diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index 0ba8857..c886113 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -428,12 +428,12 @@ _request_firmware(const struct firmware **firmware_p, const char *name,
 	if (!firmware)
 		return -ENOMEM;
 
-	mutex_lock(&fw_lock);
 	tmp = kzalloc(sizeof(struct firmware_list), GFP_KERNEL);
 	if (!tmp) {
 		retval = -ENOMEM;
 		goto error_kfree_fw;
 	}
+	mutex_lock(&fw_lock);
 	tmp->name = kstrdup(name, GFP_KERNEL);
 	if (!tmp->name) {
 		retval = -ENOMEM;



--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] firmware: avoiding multiple replication for same..., Jaswinder Singh, (Wed Aug 6, 5:46 am)