[BusyBox-cvs] busybox/modutils modprobe.c,1.28,1.29

Erik Andersen andersen at busybox.net
Tue Apr 6 12:04:16 UTC 2004


Update of /var/cvs/busybox/modutils
In directory nail:/tmp/cvs-serv14943/modutils

Modified Files:
	modprobe.c 
Log Message:
Michael Tokarev, mjt at tls dot msk dot ru writes:

Initialize all fields of struct dep_t.
Without that, e.g. `busybox modprobe -v char-major-10-144' *sometimes*
fails this way (strace):

 write(1, "insmod    nvram `\213\f\10\n", 21) = 21

Note the garbage after module name which is taken from the m_options field,
which is not initialized in the alias reading/parsing part.
(Shell properly complains to this command, telling it can't find the
closing backtick)


Index: modprobe.c
===================================================================
RCS file: /var/cvs/busybox/modutils/modprobe.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- a/modprobe.c	10 Jan 2004 11:29:31 -0000	1.28
+++ b/modprobe.c	6 Apr 2004 12:04:14 -0000	1.29
@@ -306,10 +306,10 @@
 					// fprintf ( stderr, "ALIAS: '%s' -> '%s'\n", alias, mod );
 
 					if ( !current ) {
-						first = current = (struct dep_t *) xmalloc ( sizeof ( struct dep_t ));
+						first = current = (struct dep_t *) xcalloc ( 1, sizeof ( struct dep_t ));
 					}
 					else {
-						current-> m_next = (struct dep_t *) xmalloc ( sizeof ( struct dep_t ));
+						current-> m_next = (struct dep_t *) xcalloc ( 1, sizeof ( struct dep_t ));
 						current = current-> m_next;
 					}
 					current-> m_module  = bb_xstrdup ( alias );




More information about the busybox-cvs mailing list