diff options
-rw-r--r-- | Documentation/kernel-parameters.txt | 40 | ||||
-rw-r--r-- | drivers/hid/hid-lg4ff.c | 2 | ||||
-rw-r--r-- | drivers/hid/hid-picolcd_fb.c | 2 | ||||
-rw-r--r-- | drivers/mtd/devices/docg3.c | 4 | ||||
-rw-r--r-- | drivers/regulator/virtual.c | 10 | ||||
-rw-r--r-- | drivers/scsi/pm8001/pm8001_ctl.c | 2 | ||||
-rw-r--r-- | drivers/video/fbdev/sm501fb.c | 2 | ||||
-rw-r--r-- | include/linux/cpumask.h | 2 | ||||
-rw-r--r-- | include/linux/moduleparam.h | 2 | ||||
-rw-r--r-- | init/main.c | 33 | ||||
-rw-r--r-- | kernel/module.c | 44 | ||||
-rw-r--r-- | kernel/params.c | 25 | ||||
-rw-r--r-- | samples/kobject/kobject-example.c | 7 | ||||
-rw-r--r-- | samples/kobject/kset-example.c | 7 | ||||
-rw-r--r-- | scripts/mod/modpost.c | 2 |
15 files changed, 117 insertions, 67 deletions
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index b9f67781c577..6eaa9cdb7094 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -1,27 +1,37 @@ | |||
1 | Kernel Parameters | 1 | Kernel Parameters |
2 | ~~~~~~~~~~~~~~~~~ | 2 | ~~~~~~~~~~~~~~~~~ |
3 | 3 | ||
4 | The following is a consolidated list of the kernel parameters as implemented | 4 | The following is a consolidated list of the kernel parameters as |
5 | (mostly) by the __setup() macro and sorted into English Dictionary order | 5 | implemented by the __setup(), core_param() and module_param() macros |
6 | (defined as ignoring all punctuation and sorting digits before letters in a | 6 | and sorted into English Dictionary order (defined as ignoring all |
7 | case insensitive manner), and with descriptions where known. | 7 | punctuation and sorting digits before letters in a case insensitive |
8 | 8 | manner), and with descriptions where known. | |
9 | Module parameters for loadable modules are specified only as the | 9 | |
10 | parameter name with optional '=' and value as appropriate, such as: | 10 | The kernel parses parameters from the kernel command line up to "--"; |
11 | 11 | if it doesn't recognize a parameter and it doesn't contain a '.', the | |
12 | modprobe usbcore blinkenlights=1 | 12 | parameter gets passed to init: parameters with '=' go into init's |
13 | 13 | environment, others are passed as command line arguments to init. | |
14 | Module parameters for modules that are built into the kernel image | 14 | Everything after "--" is passed as an argument to init. |
15 | are specified on the kernel command line with the module name plus | 15 | |
16 | '.' plus parameter name, with '=' and value if appropriate, such as: | 16 | Module parameters can be specified in two ways: via the kernel command |
17 | 17 | line with a module name prefix, or via modprobe, e.g.: | |
18 | usbcore.blinkenlights=1 | 18 | |
19 | (kernel command line) usbcore.blinkenlights=1 | ||
20 | (modprobe command line) modprobe usbcore blinkenlights=1 | ||
21 | |||
22 | Parameters for modules which are built into the kernel need to be | ||
23 | specified on the kernel command line. modprobe looks through the | ||
24 | kernel command line (/proc/cmdline) and collects module parameters | ||
25 | when it loads a module, so the kernel command line can be used for | ||
26 | loadable modules too. | ||
19 | 27 | ||
20 | Hyphens (dashes) and underscores are equivalent in parameter names, so | 28 | Hyphens (dashes) and underscores are equivalent in parameter names, so |
21 | log_buf_len=1M print-fatal-signals=1 | 29 | log_buf_len=1M print-fatal-signals=1 |
22 | can also be entered as | 30 | can also be entered as |
23 | log-buf-len=1M print_fatal_signals=1 | 31 | log-buf-len=1M print_fatal_signals=1 |
24 | 32 | ||
33 | Double-quotes can be used to protect spaces in values, e.g.: | ||
34 | param="spaces in here" | ||
25 | 35 | ||
26 | This document may not be entirely up to date and comprehensive. The command | 36 | This document may not be entirely up to date and comprehensive. The command |
27 | "modinfo -p ${modulename}" shows a current list of all parameters of a loadable | 37 | "modinfo -p ${modulename}" shows a current list of all parameters of a loadable |
diff --git a/drivers/hid/hid-lg4ff.c b/drivers/hid/hid-lg4ff.c index 24883b4d1a49..cc2bd2022198 100644 --- a/drivers/hid/hid-lg4ff.c +++ b/drivers/hid/hid-lg4ff.c | |||
@@ -52,7 +52,7 @@ static void hid_lg4ff_set_range_g25(struct hid_device *hid, u16 range); | |||
52 | static ssize_t lg4ff_range_show(struct device *dev, struct device_attribute *attr, char *buf); | 52 | static ssize_t lg4ff_range_show(struct device *dev, struct device_attribute *attr, char *buf); |
53 | static ssize_t lg4ff_range_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count); | 53 | static ssize_t lg4ff_range_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count); |
54 | 54 | ||
55 | static DEVICE_ATTR(range, S_IRWXU | S_IRWXG | S_IRWXO, lg4ff_range_show, lg4ff_range_store); | 55 | static DEVICE_ATTR(range, S_IRWXU | S_IRWXG | S_IROTH, lg4ff_range_show, lg4ff_range_store); |
56 | 56 | ||
57 | struct lg4ff_device_entry { | 57 | struct lg4ff_device_entry { |
58 | __u32 product_id; | 58 | __u32 product_id; |
diff --git a/drivers/hid/hid-picolcd_fb.c b/drivers/hid/hid-picolcd_fb.c index c930ab8554ea..7f965e231433 100644 --- a/drivers/hid/hid-picolcd_fb.c +++ b/drivers/hid/hid-picolcd_fb.c | |||
@@ -501,7 +501,7 @@ static ssize_t picolcd_fb_update_rate_store(struct device *dev, | |||
501 | return count; | 501 | return count; |
502 | } | 502 | } |
503 | 503 | ||
504 | static DEVICE_ATTR(fb_update_rate, 0666, picolcd_fb_update_rate_show, | 504 | static DEVICE_ATTR(fb_update_rate, 0664, picolcd_fb_update_rate_show, |
505 | picolcd_fb_update_rate_store); | 505 | picolcd_fb_update_rate_store); |
506 | 506 | ||
507 | /* initialize Framebuffer device */ | 507 | /* initialize Framebuffer device */ |
diff --git a/drivers/mtd/devices/docg3.c b/drivers/mtd/devices/docg3.c index dd5e1018d37b..91a169c44b39 100644 --- a/drivers/mtd/devices/docg3.c +++ b/drivers/mtd/devices/docg3.c | |||
@@ -1608,8 +1608,8 @@ static ssize_t dps1_insert_key(struct device *dev, | |||
1608 | #define FLOOR_SYSFS(id) { \ | 1608 | #define FLOOR_SYSFS(id) { \ |
1609 | __ATTR(f##id##_dps0_is_keylocked, S_IRUGO, dps0_is_key_locked, NULL), \ | 1609 | __ATTR(f##id##_dps0_is_keylocked, S_IRUGO, dps0_is_key_locked, NULL), \ |
1610 | __ATTR(f##id##_dps1_is_keylocked, S_IRUGO, dps1_is_key_locked, NULL), \ | 1610 | __ATTR(f##id##_dps1_is_keylocked, S_IRUGO, dps1_is_key_locked, NULL), \ |
1611 | __ATTR(f##id##_dps0_protection_key, S_IWUGO, NULL, dps0_insert_key), \ | 1611 | __ATTR(f##id##_dps0_protection_key, S_IWUSR|S_IWGRP, NULL, dps0_insert_key), \ |
1612 | __ATTR(f##id##_dps1_protection_key, S_IWUGO, NULL, dps1_insert_key), \ | 1612 | __ATTR(f##id##_dps1_protection_key, S_IWUSR|S_IWGRP, NULL, dps1_insert_key), \ |
1613 | } | 1613 | } |
1614 | 1614 | ||
1615 | static struct device_attribute doc_sys_attrs[DOC_MAX_NBFLOORS][4] = { | 1615 | static struct device_attribute doc_sys_attrs[DOC_MAX_NBFLOORS][4] = { |
diff --git a/drivers/regulator/virtual.c b/drivers/regulator/virtual.c index f53e78b9a84e..6ff95b045984 100644 --- a/drivers/regulator/virtual.c +++ b/drivers/regulator/virtual.c | |||
@@ -266,11 +266,11 @@ static ssize_t set_mode(struct device *dev, struct device_attribute *attr, | |||
266 | return count; | 266 | return count; |
267 | } | 267 | } |
268 | 268 | ||
269 | static DEVICE_ATTR(min_microvolts, 0666, show_min_uV, set_min_uV); | 269 | static DEVICE_ATTR(min_microvolts, 0664, show_min_uV, set_min_uV); |
270 | static DEVICE_ATTR(max_microvolts, 0666, show_max_uV, set_max_uV); | 270 | static DEVICE_ATTR(max_microvolts, 0664, show_max_uV, set_max_uV); |
271 | static DEVICE_ATTR(min_microamps, 0666, show_min_uA, set_min_uA); | 271 | static DEVICE_ATTR(min_microamps, 0664, show_min_uA, set_min_uA); |
272 | static DEVICE_ATTR(max_microamps, 0666, show_max_uA, set_max_uA); | 272 | static DEVICE_ATTR(max_microamps, 0664, show_max_uA, set_max_uA); |
273 | static DEVICE_ATTR(mode, 0666, show_mode, set_mode); | 273 | static DEVICE_ATTR(mode, 0664, show_mode, set_mode); |
274 | 274 | ||
275 | static struct attribute *regulator_virtual_attributes[] = { | 275 | static struct attribute *regulator_virtual_attributes[] = { |
276 | &dev_attr_min_microvolts.attr, | 276 | &dev_attr_min_microvolts.attr, |
diff --git a/drivers/scsi/pm8001/pm8001_ctl.c b/drivers/scsi/pm8001/pm8001_ctl.c index fe5eee4d0a11..a368d77b8d41 100644 --- a/drivers/scsi/pm8001/pm8001_ctl.c +++ b/drivers/scsi/pm8001/pm8001_ctl.c | |||
@@ -732,7 +732,7 @@ static ssize_t pm8001_show_update_fw(struct device *cdev, | |||
732 | flash_error_table[i].reason); | 732 | flash_error_table[i].reason); |
733 | } | 733 | } |
734 | 734 | ||
735 | static DEVICE_ATTR(update_fw, S_IRUGO|S_IWUGO, | 735 | static DEVICE_ATTR(update_fw, S_IRUGO|S_IWUSR|S_IWGRP, |
736 | pm8001_show_update_fw, pm8001_store_update_fw); | 736 | pm8001_show_update_fw, pm8001_store_update_fw); |
737 | struct device_attribute *pm8001_host_attrs[] = { | 737 | struct device_attribute *pm8001_host_attrs[] = { |
738 | &dev_attr_interface_rev, | 738 | &dev_attr_interface_rev, |
diff --git a/drivers/video/fbdev/sm501fb.c b/drivers/video/fbdev/sm501fb.c index 1501979099dc..c2c8eb668784 100644 --- a/drivers/video/fbdev/sm501fb.c +++ b/drivers/video/fbdev/sm501fb.c | |||
@@ -1215,7 +1215,7 @@ static ssize_t sm501fb_crtsrc_store(struct device *dev, | |||
1215 | } | 1215 | } |
1216 | 1216 | ||
1217 | /* Prepare the device_attr for registration with sysfs later */ | 1217 | /* Prepare the device_attr for registration with sysfs later */ |
1218 | static DEVICE_ATTR(crt_src, 0666, sm501fb_crtsrc_show, sm501fb_crtsrc_store); | 1218 | static DEVICE_ATTR(crt_src, 0664, sm501fb_crtsrc_show, sm501fb_crtsrc_store); |
1219 | 1219 | ||
1220 | /* sm501fb_show_regs | 1220 | /* sm501fb_show_regs |
1221 | * | 1221 | * |
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index d08e4d2a9b92..3557ea7b2049 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
@@ -600,7 +600,7 @@ static inline int cpulist_scnprintf(char *buf, int len, | |||
600 | static inline int cpumask_parse(const char *buf, struct cpumask *dstp) | 600 | static inline int cpumask_parse(const char *buf, struct cpumask *dstp) |
601 | { | 601 | { |
602 | char *nl = strchr(buf, '\n'); | 602 | char *nl = strchr(buf, '\n'); |
603 | int len = nl ? nl - buf : strlen(buf); | 603 | unsigned int len = nl ? (unsigned int)(nl - buf) : strlen(buf); |
604 | 604 | ||
605 | return bitmap_parse(buf, len, cpumask_bits(dstp), nr_cpumask_bits); | 605 | return bitmap_parse(buf, len, cpumask_bits(dstp), nr_cpumask_bits); |
606 | } | 606 | } |
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h index 204a67743804..b1990c5524e1 100644 --- a/include/linux/moduleparam.h +++ b/include/linux/moduleparam.h | |||
@@ -321,7 +321,7 @@ extern bool parameq(const char *name1, const char *name2); | |||
321 | extern bool parameqn(const char *name1, const char *name2, size_t n); | 321 | extern bool parameqn(const char *name1, const char *name2, size_t n); |
322 | 322 | ||
323 | /* Called on module insert or kernel boot */ | 323 | /* Called on module insert or kernel boot */ |
324 | extern int parse_args(const char *name, | 324 | extern char *parse_args(const char *name, |
325 | char *args, | 325 | char *args, |
326 | const struct kernel_param *params, | 326 | const struct kernel_param *params, |
327 | unsigned num, | 327 | unsigned num, |
diff --git a/init/main.c b/init/main.c index 0ec25157deef..e8ae1fef0908 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -253,6 +253,27 @@ static int __init repair_env_string(char *param, char *val, const char *unused) | |||
253 | return 0; | 253 | return 0; |
254 | } | 254 | } |
255 | 255 | ||
256 | /* Anything after -- gets handed straight to init. */ | ||
257 | static int __init set_init_arg(char *param, char *val, const char *unused) | ||
258 | { | ||
259 | unsigned int i; | ||
260 | |||
261 | if (panic_later) | ||
262 | return 0; | ||
263 | |||
264 | repair_env_string(param, val, unused); | ||
265 | |||
266 | for (i = 0; argv_init[i]; i++) { | ||
267 | if (i == MAX_INIT_ARGS) { | ||
268 | panic_later = "init"; | ||
269 | panic_param = param; | ||
270 | return 0; | ||
271 | } | ||
272 | } | ||
273 | argv_init[i] = param; | ||
274 | return 0; | ||
275 | } | ||
276 | |||
256 | /* | 277 | /* |
257 | * Unknown boot options get handed to init, unless they look like | 278 | * Unknown boot options get handed to init, unless they look like |
258 | * unused parameters (modprobe will find them in /proc/cmdline). | 279 | * unused parameters (modprobe will find them in /proc/cmdline). |
@@ -479,7 +500,7 @@ static void __init mm_init(void) | |||
479 | 500 | ||
480 | asmlinkage __visible void __init start_kernel(void) | 501 | asmlinkage __visible void __init start_kernel(void) |
481 | { | 502 | { |
482 | char * command_line; | 503 | char * command_line, *after_dashes; |
483 | extern const struct kernel_param __start___param[], __stop___param[]; | 504 | extern const struct kernel_param __start___param[], __stop___param[]; |
484 | 505 | ||
485 | /* | 506 | /* |
@@ -519,9 +540,13 @@ asmlinkage __visible void __init start_kernel(void) | |||
519 | 540 | ||
520 | pr_notice("Kernel command line: %s\n", boot_command_line); | 541 | pr_notice("Kernel command line: %s\n", boot_command_line); |
521 | parse_early_param(); | 542 | parse_early_param(); |
522 | parse_args("Booting kernel", static_command_line, __start___param, | 543 | after_dashes = parse_args("Booting kernel", |
523 | __stop___param - __start___param, | 544 | static_command_line, __start___param, |
524 | -1, -1, &unknown_bootoption); | 545 | __stop___param - __start___param, |
546 | -1, -1, &unknown_bootoption); | ||
547 | if (after_dashes) | ||
548 | parse_args("Setting init args", after_dashes, NULL, 0, -1, -1, | ||
549 | set_init_arg); | ||
525 | 550 | ||
526 | jump_label_init(); | 551 | jump_label_init(); |
527 | 552 | ||
diff --git a/kernel/module.c b/kernel/module.c index 079c4615607d..81e727cf6df9 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -3020,21 +3020,6 @@ static int do_init_module(struct module *mod) | |||
3020 | */ | 3020 | */ |
3021 | current->flags &= ~PF_USED_ASYNC; | 3021 | current->flags &= ~PF_USED_ASYNC; |
3022 | 3022 | ||
3023 | blocking_notifier_call_chain(&module_notify_list, | ||
3024 | MODULE_STATE_COMING, mod); | ||
3025 | |||
3026 | /* Set RO and NX regions for core */ | ||
3027 | set_section_ro_nx(mod->module_core, | ||
3028 | mod->core_text_size, | ||
3029 | mod->core_ro_size, | ||
3030 | mod->core_size); | ||
3031 | |||
3032 | /* Set RO and NX regions for init */ | ||
3033 | set_section_ro_nx(mod->module_init, | ||
3034 | mod->init_text_size, | ||
3035 | mod->init_ro_size, | ||
3036 | mod->init_size); | ||
3037 | |||
3038 | do_mod_ctors(mod); | 3023 | do_mod_ctors(mod); |
3039 | /* Start the module */ | 3024 | /* Start the module */ |
3040 | if (mod->init != NULL) | 3025 | if (mod->init != NULL) |
@@ -3165,9 +3150,26 @@ static int complete_formation(struct module *mod, struct load_info *info) | |||
3165 | /* This relies on module_mutex for list integrity. */ | 3150 | /* This relies on module_mutex for list integrity. */ |
3166 | module_bug_finalize(info->hdr, info->sechdrs, mod); | 3151 | module_bug_finalize(info->hdr, info->sechdrs, mod); |
3167 | 3152 | ||
3153 | /* Set RO and NX regions for core */ | ||
3154 | set_section_ro_nx(mod->module_core, | ||
3155 | mod->core_text_size, | ||
3156 | mod->core_ro_size, | ||
3157 | mod->core_size); | ||
3158 | |||
3159 | /* Set RO and NX regions for init */ | ||
3160 | set_section_ro_nx(mod->module_init, | ||
3161 | mod->init_text_size, | ||
3162 | mod->init_ro_size, | ||
3163 | mod->init_size); | ||
3164 | |||
3168 | /* Mark state as coming so strong_try_module_get() ignores us, | 3165 | /* Mark state as coming so strong_try_module_get() ignores us, |
3169 | * but kallsyms etc. can see us. */ | 3166 | * but kallsyms etc. can see us. */ |
3170 | mod->state = MODULE_STATE_COMING; | 3167 | mod->state = MODULE_STATE_COMING; |
3168 | mutex_unlock(&module_mutex); | ||
3169 | |||
3170 | blocking_notifier_call_chain(&module_notify_list, | ||
3171 | MODULE_STATE_COMING, mod); | ||
3172 | return 0; | ||
3171 | 3173 | ||
3172 | out: | 3174 | out: |
3173 | mutex_unlock(&module_mutex); | 3175 | mutex_unlock(&module_mutex); |
@@ -3190,6 +3192,7 @@ static int load_module(struct load_info *info, const char __user *uargs, | |||
3190 | { | 3192 | { |
3191 | struct module *mod; | 3193 | struct module *mod; |
3192 | long err; | 3194 | long err; |
3195 | char *after_dashes; | ||
3193 | 3196 | ||
3194 | err = module_sig_check(info); | 3197 | err = module_sig_check(info); |
3195 | if (err) | 3198 | if (err) |
@@ -3277,10 +3280,15 @@ static int load_module(struct load_info *info, const char __user *uargs, | |||
3277 | goto ddebug_cleanup; | 3280 | goto ddebug_cleanup; |
3278 | 3281 | ||
3279 | /* Module is ready to execute: parsing args may do that. */ | 3282 | /* Module is ready to execute: parsing args may do that. */ |
3280 | err = parse_args(mod->name, mod->args, mod->kp, mod->num_kp, | 3283 | after_dashes = parse_args(mod->name, mod->args, mod->kp, mod->num_kp, |
3281 | -32768, 32767, unknown_module_param_cb); | 3284 | -32768, 32767, unknown_module_param_cb); |
3282 | if (err < 0) | 3285 | if (IS_ERR(after_dashes)) { |
3286 | err = PTR_ERR(after_dashes); | ||
3283 | goto bug_cleanup; | 3287 | goto bug_cleanup; |
3288 | } else if (after_dashes) { | ||
3289 | pr_warn("%s: parameters '%s' after `--' ignored\n", | ||
3290 | mod->name, after_dashes); | ||
3291 | } | ||
3284 | 3292 | ||
3285 | /* Link in to syfs. */ | 3293 | /* Link in to syfs. */ |
3286 | err = mod_sysfs_setup(mod, info, mod->kp, mod->num_kp); | 3294 | err = mod_sysfs_setup(mod, info, mod->kp, mod->num_kp); |
diff --git a/kernel/params.c b/kernel/params.c index b00142e7f3ba..1e52ca233fd9 100644 --- a/kernel/params.c +++ b/kernel/params.c | |||
@@ -177,13 +177,13 @@ static char *next_arg(char *args, char **param, char **val) | |||
177 | } | 177 | } |
178 | 178 | ||
179 | /* Args looks like "foo=bar,bar2 baz=fuz wiz". */ | 179 | /* Args looks like "foo=bar,bar2 baz=fuz wiz". */ |
180 | int parse_args(const char *doing, | 180 | char *parse_args(const char *doing, |
181 | char *args, | 181 | char *args, |
182 | const struct kernel_param *params, | 182 | const struct kernel_param *params, |
183 | unsigned num, | 183 | unsigned num, |
184 | s16 min_level, | 184 | s16 min_level, |
185 | s16 max_level, | 185 | s16 max_level, |
186 | int (*unknown)(char *param, char *val, const char *doing)) | 186 | int (*unknown)(char *param, char *val, const char *doing)) |
187 | { | 187 | { |
188 | char *param, *val; | 188 | char *param, *val; |
189 | 189 | ||
@@ -198,6 +198,9 @@ int parse_args(const char *doing, | |||
198 | int irq_was_disabled; | 198 | int irq_was_disabled; |
199 | 199 | ||
200 | args = next_arg(args, ¶m, &val); | 200 | args = next_arg(args, ¶m, &val); |
201 | /* Stop at -- */ | ||
202 | if (!val && strcmp(param, "--") == 0) | ||
203 | return args; | ||
201 | irq_was_disabled = irqs_disabled(); | 204 | irq_was_disabled = irqs_disabled(); |
202 | ret = parse_one(param, val, doing, params, num, | 205 | ret = parse_one(param, val, doing, params, num, |
203 | min_level, max_level, unknown); | 206 | min_level, max_level, unknown); |
@@ -208,22 +211,22 @@ int parse_args(const char *doing, | |||
208 | switch (ret) { | 211 | switch (ret) { |
209 | case -ENOENT: | 212 | case -ENOENT: |
210 | pr_err("%s: Unknown parameter `%s'\n", doing, param); | 213 | pr_err("%s: Unknown parameter `%s'\n", doing, param); |
211 | return ret; | 214 | return ERR_PTR(ret); |
212 | case -ENOSPC: | 215 | case -ENOSPC: |
213 | pr_err("%s: `%s' too large for parameter `%s'\n", | 216 | pr_err("%s: `%s' too large for parameter `%s'\n", |
214 | doing, val ?: "", param); | 217 | doing, val ?: "", param); |
215 | return ret; | 218 | return ERR_PTR(ret); |
216 | case 0: | 219 | case 0: |
217 | break; | 220 | break; |
218 | default: | 221 | default: |
219 | pr_err("%s: `%s' invalid for parameter `%s'\n", | 222 | pr_err("%s: `%s' invalid for parameter `%s'\n", |
220 | doing, val ?: "", param); | 223 | doing, val ?: "", param); |
221 | return ret; | 224 | return ERR_PTR(ret); |
222 | } | 225 | } |
223 | } | 226 | } |
224 | 227 | ||
225 | /* All parsed OK. */ | 228 | /* All parsed OK. */ |
226 | return 0; | 229 | return NULL; |
227 | } | 230 | } |
228 | 231 | ||
229 | /* Lazy bastard, eh? */ | 232 | /* Lazy bastard, eh? */ |
diff --git a/samples/kobject/kobject-example.c b/samples/kobject/kobject-example.c index 86ea0c3ad975..01562e0d4992 100644 --- a/samples/kobject/kobject-example.c +++ b/samples/kobject/kobject-example.c | |||
@@ -40,8 +40,9 @@ static ssize_t foo_store(struct kobject *kobj, struct kobj_attribute *attr, | |||
40 | return count; | 40 | return count; |
41 | } | 41 | } |
42 | 42 | ||
43 | /* Sysfs attributes cannot be world-writable. */ | ||
43 | static struct kobj_attribute foo_attribute = | 44 | static struct kobj_attribute foo_attribute = |
44 | __ATTR(foo, 0666, foo_show, foo_store); | 45 | __ATTR(foo, 0664, foo_show, foo_store); |
45 | 46 | ||
46 | /* | 47 | /* |
47 | * More complex function where we determine which variable is being accessed by | 48 | * More complex function where we determine which variable is being accessed by |
@@ -73,9 +74,9 @@ static ssize_t b_store(struct kobject *kobj, struct kobj_attribute *attr, | |||
73 | } | 74 | } |
74 | 75 | ||
75 | static struct kobj_attribute baz_attribute = | 76 | static struct kobj_attribute baz_attribute = |
76 | __ATTR(baz, 0666, b_show, b_store); | 77 | __ATTR(baz, 0664, b_show, b_store); |
77 | static struct kobj_attribute bar_attribute = | 78 | static struct kobj_attribute bar_attribute = |
78 | __ATTR(bar, 0666, b_show, b_store); | 79 | __ATTR(bar, 0664, b_show, b_store); |
79 | 80 | ||
80 | 81 | ||
81 | /* | 82 | /* |
diff --git a/samples/kobject/kset-example.c b/samples/kobject/kset-example.c index 5dce351f131f..ab5e447ec238 100644 --- a/samples/kobject/kset-example.c +++ b/samples/kobject/kset-example.c | |||
@@ -124,8 +124,9 @@ static ssize_t foo_store(struct foo_obj *foo_obj, struct foo_attribute *attr, | |||
124 | return count; | 124 | return count; |
125 | } | 125 | } |
126 | 126 | ||
127 | /* Sysfs attributes cannot be world-writable. */ | ||
127 | static struct foo_attribute foo_attribute = | 128 | static struct foo_attribute foo_attribute = |
128 | __ATTR(foo, 0666, foo_show, foo_store); | 129 | __ATTR(foo, 0664, foo_show, foo_store); |
129 | 130 | ||
130 | /* | 131 | /* |
131 | * More complex function where we determine which variable is being accessed by | 132 | * More complex function where we determine which variable is being accessed by |
@@ -157,9 +158,9 @@ static ssize_t b_store(struct foo_obj *foo_obj, struct foo_attribute *attr, | |||
157 | } | 158 | } |
158 | 159 | ||
159 | static struct foo_attribute baz_attribute = | 160 | static struct foo_attribute baz_attribute = |
160 | __ATTR(baz, 0666, b_show, b_store); | 161 | __ATTR(baz, 0664, b_show, b_store); |
161 | static struct foo_attribute bar_attribute = | 162 | static struct foo_attribute bar_attribute = |
162 | __ATTR(bar, 0666, b_show, b_store); | 163 | __ATTR(bar, 0664, b_show, b_store); |
163 | 164 | ||
164 | /* | 165 | /* |
165 | * Create a group of attributes so that we can create and destroy them all | 166 | * Create a group of attributes so that we can create and destroy them all |
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index ea7f9530afa2..026543ba8d86 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c | |||
@@ -2113,8 +2113,10 @@ static void read_dump(const char *fname, unsigned int kernel) | |||
2113 | s->preloaded = 1; | 2113 | s->preloaded = 1; |
2114 | sym_update_crc(symname, mod, crc, export_no(export)); | 2114 | sym_update_crc(symname, mod, crc, export_no(export)); |
2115 | } | 2115 | } |
2116 | release_file(file, size); | ||
2116 | return; | 2117 | return; |
2117 | fail: | 2118 | fail: |
2119 | release_file(file, size); | ||
2118 | fatal("parse error in symbol dump file\n"); | 2120 | fatal("parse error in symbol dump file\n"); |
2119 | } | 2121 | } |
2120 | 2122 | ||