lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 06 Aug 2008 15:16:23 +0530
From:	Jaswinder Singh <jaswinder@...radead.org>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	linux-kernel@...r.kernel.org, dwmw2@...radead.org
Subject: Re: [PATCH] firmware: avoiding multiple replication for same
	firmware file

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;



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ