Merge git://github.com/rustyrussell/linux
* git://github.com/rustyrussell/linux: params: make dashes and underscores in parameter names truly equal kmod: prevent kmod_loop_msg overflow in __request_module()
这个提交包含在:
@@ -114,10 +114,12 @@ int __request_module(bool wait, const char *fmt, ...)
|
||||
atomic_inc(&kmod_concurrent);
|
||||
if (atomic_read(&kmod_concurrent) > max_modprobes) {
|
||||
/* We may be blaming an innocent here, but unlikely */
|
||||
if (kmod_loop_msg++ < 5)
|
||||
if (kmod_loop_msg < 5) {
|
||||
printk(KERN_ERR
|
||||
"request_module: runaway loop modprobe %s\n",
|
||||
module_name);
|
||||
kmod_loop_msg++;
|
||||
}
|
||||
atomic_dec(&kmod_concurrent);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
@@ -67,20 +67,27 @@ static void maybe_kfree_parameter(void *param)
|
||||
}
|
||||
}
|
||||
|
||||
static inline char dash2underscore(char c)
|
||||
static char dash2underscore(char c)
|
||||
{
|
||||
if (c == '-')
|
||||
return '_';
|
||||
return c;
|
||||
}
|
||||
|
||||
static inline int parameq(const char *input, const char *paramname)
|
||||
bool parameqn(const char *a, const char *b, size_t n)
|
||||
{
|
||||
unsigned int i;
|
||||
for (i = 0; dash2underscore(input[i]) == paramname[i]; i++)
|
||||
if (input[i] == '\0')
|
||||
return 1;
|
||||
return 0;
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
if (dash2underscore(a[i]) != dash2underscore(b[i]))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool parameq(const char *a, const char *b)
|
||||
{
|
||||
return parameqn(a, b, strlen(a)+1);
|
||||
}
|
||||
|
||||
static int parse_one(char *param,
|
||||
|
在新工单中引用
屏蔽一个用户