lkml.org 
[lkml]   [2008]   [Aug]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH] firmware: avoiding multiple replication for same firmware file
From
Date
Sorry, minor correction.

On Wed, 2008-08-06 at 15:05 +0530, Jaswinder Singh wrote:
> +
> + mutex_lock(&fw_lock);
> + tmp = kzalloc(sizeof(struct firmware_list), GFP_KERNEL);
> + if (!tmp) {
> retval = -ENOMEM;
> - goto out;
> + goto error_kfree_fw;
> + }
> + tmp->name = kstrdup(name, GFP_KERNEL);
> + if (!tmp->name) {
> + retval = -ENOMEM;
> + goto error_kfree_fw_list;
> }

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;




\
 
 \ /
  Last update: 2008-08-06 11:51    [W:0.047 / U:0.932 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site