From: Lucas De Marchi Date: Sun, 8 Jan 2012 20:08:05 +0000 (-0200) Subject: modprobe: fix error path when loading dependencies X-Git-Tag: v4~75 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb0d0b72128ac566aad9a72800c5a64af66f0b6e;p=thirdparty%2Fkmod.git modprobe: fix error path when loading dependencies demarchi> scenario is the following: demarchi> modA depends on modB and modC demarchi> if there's a race when trying to insert a dependency of a module, say modB, it will stop loading all the modules demarchi> it should check by "module already loaded error" demarchi> like it does for modA --- diff --git a/tools/kmod-modprobe.c b/tools/kmod-modprobe.c index eaf9346a..2cda9353 100644 --- a/tools/kmod-modprobe.c +++ b/tools/kmod-modprobe.c @@ -666,9 +666,11 @@ static int insmod_do_deps_list(struct kmod_module *parent, struct kmod_list *dep flags |= KMOD_INSERT_FORCE_VERMAGIC; r = kmod_module_insert_module(dm, flags, opts); + if (r == -EEXIST && !first_time) + r = 0; if (r < 0) { WRN("could not insert '%s': %s\n", - dmname, strerror(-r)); + dmname, strerror(-r)); goto dep_error; } }