lkml.org 
[lkml]   [2004]   [Feb]   [29]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
FromDmitry Torokhov <>
Subject[PATCH 1/2] Pin firmware module (was Re: [PATCH] request_firmware(): fixes and polishing.)
DateSun, 29 Feb 2004 01:32:55 -0500
===================================================================

ChangeSet@1.1694, 2004-02-29 00:06:09-05:00, dtor_core@ameritech.net
  Firmware loader:
    We need to pin the firmware loader module until the last reference
    to the firmware class device is dropped and the class device is
    destroyed.


 firmware_class.c |    6 ++++++
 1 files changed, 6 insertions(+)

===================================================================


diff -Nru a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
--- a/drivers/base/firmware_class.c	Sun Feb 29 01:20:57 2004
+++ b/drivers/base/firmware_class.c	Sun Feb 29 01:20:57 2004
@@ -263,6 +263,8 @@
 
 	kfree(fw_priv);
 	kfree(class_dev);
+
+	module_put(THIS_MODULE);
 }
 
 static void
@@ -325,6 +327,7 @@
 	kfree(class_dev);
 	return retval;
 }
+
 static int
 fw_setup_class_device(struct firmware *fw, struct class_device **class_dev_p,
 		      const char *fw_name, struct device *device)
@@ -337,6 +340,9 @@
 	retval = fw_register_class_device(&class_dev, fw_name, device);
 	if (retval)
 		goto out;
+
+	/* Need to pin this module until class device is destroyed */
+	__module_get(THIS_MODULE);
 
 	fw_priv = class_get_devdata(class_dev);
 
-
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/
\
 
 \ /
  Last update: 2005-03-22 13:01    [from the cache]
©2003-2008