Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1764141AbYHFJsd (ORCPT ); Wed, 6 Aug 2008 05:48:33 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755139AbYHFJsB (ORCPT ); Wed, 6 Aug 2008 05:48:01 -0400 Received: from casper.infradead.org ([85.118.1.10]:38945 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753588AbYHFJsA (ORCPT ); Wed, 6 Aug 2008 05:48:00 -0400 Subject: Re: [PATCH] firmware: avoiding multiple replication for same firmware file From: Jaswinder Singh To: Andrew Morton Cc: linux-kernel@vger.kernel.org, dwmw2@infradead.org In-Reply-To: <1218015313.3044.6.camel@jaswinder.satnam> References: <1217570459.2902.1.camel@jaswinder.satnam> <20080805140327.16494fb0.akpm@linux-foundation.org> <1218015313.3044.6.camel@jaswinder.satnam> Content-Type: text/plain Date: Wed, 06 Aug 2008 15:16:23 +0530 Message-Id: <1218015983.3044.10.camel@jaswinder.satnam> Mime-Version: 1.0 X-Mailer: Evolution 2.22.1 (2.22.1-2.fc9) Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1196 Lines: 43 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/