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

From: Jaswinder Singh
Date: Wed Aug 06 2008 - 06:18:18 EST


On Wed, 2008-08-06 at 15:05 +0530, Jaswinder Singh wrote:
> @@ -445,12 +484,22 @@ _request_firmware(const struct firmware **firmware_p, const char *name,
> retval = -ENOENT;
> release_firmware(fw_priv->fw);
> *firmware_p = NULL;
> + list_del(&tmp->list);
> + kfree(tmp->name);
> + kfree(tmp);
> }
> fw_priv->fw = NULL;
> mutex_unlock(&fw_lock);

This is also not required as we are doing this in release_firmware().
So :

diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index c886113..7b268d1 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -484,9 +484,6 @@ _request_firmware(const struct firmware **firmware_p, const char *name,
retval = -ENOENT;
release_firmware(fw_priv->fw);
*firmware_p = NULL;
- list_del(&tmp->list);
- kfree(tmp->name);
- kfree(tmp);
}
fw_priv->fw = NULL;
mutex_unlock(&fw_lock);


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