--- zzzz-none-000/linux-2.6.32.61/kernel/kmod.c 2013-06-10 09:43:48.000000000 +0000 +++ ar9-7330-650/linux-2.6.32.61/kernel/kmod.c 2014-06-26 09:09:01.000000000 +0000 @@ -96,7 +96,6 @@ out: return -ENOMEM; } - /** * __request_module - try to load a kernel module * @wait: wait (or not) for the operation to complete @@ -161,7 +160,6 @@ trace_module_request(module_name, wait, _RET_IP_); ret = call_modprobe(module_name, wait ? UMH_WAIT_PROC : UMH_WAIT_EXEC); - atomic_dec(&kmod_concurrent); return ret; } @@ -257,7 +255,6 @@ else call_usermodehelper_freeinfo(sub_info); } - /* Keventd can't block, but this (a child) can. */ static int wait_for_helper(void *data) { @@ -313,7 +310,6 @@ if (wait != UMH_NO_WAIT) wait &= ~UMH_KILLABLE; - /* CLONE_VFORK: wait until the usermode helper has execve'd * successfully We need the data structures to stay around * until that is done. */ @@ -456,6 +452,28 @@ char **envp, gfp_t gfp_mask) { struct subprocess_info *sub_info; + + + /*--------------------------------------------------------------------------------------*\ + * AVM Speed Patch !!!! + \*--------------------------------------------------------------------------------------*/ +#if 1 + if(!strcmp(path, "/sbin/hotplug")) { + if(argv[1] && !strcmp(argv[1], "tty")) + return NULL; + if(argv[1] && !strcmp(argv[1], "bdi")) + return NULL; + if(argv[1] && !strcmp(argv[1], "mtd")) + return NULL; + if(argv[1] && !strcmp(argv[1], "capi_oslib")) + return NULL; + if(argv[1] && !strcmp(argv[1], "mem")) + return NULL; + if(argv[1] && !strcmp(argv[1], "module")) + return NULL; + } +#endif + sub_info = kzalloc(sizeof(struct subprocess_info), gfp_mask); if (!sub_info) goto out; @@ -560,6 +578,10 @@ BUG_ON(atomic_read(&sub_info->cred->usage) != 1); validate_creds(sub_info->cred); + if (!sub_info->path) { + call_usermodehelper_freeinfo(sub_info); + return -EINVAL; + } helper_lock(); if (sub_info->path[0] == '\0') goto out; @@ -575,7 +597,6 @@ queue_work(khelper_wq, &sub_info->work); if (wait == UMH_NO_WAIT) /* task has freed sub_info */ goto unlock; - if (wait & UMH_KILLABLE) { retval = wait_for_completion_killable(&done); if (!retval) @@ -586,10 +607,10 @@ goto unlock; /* fallthrough, umh_complete() was already called */ } - wait_for_completion(&done); wait_done: retval = sub_info->retval; + out: call_usermodehelper_freeinfo(sub_info); unlock: