usb: core: Check URB setup_packet and transfer_buffer sanity
[sfrench/cifs-2.6.git] / kernel / ksysfs.c
index ee1bc1bb8feb82f4873eb38106805c2823bed7b2..23cd70651238383ac0b112acf4827ebd1b1ad399 100644 (file)
@@ -125,6 +125,10 @@ static ssize_t kexec_crash_size_store(struct kobject *kobj,
 }
 KERNEL_ATTR_RW(kexec_crash_size);
 
+#endif /* CONFIG_KEXEC_CORE */
+
+#ifdef CONFIG_CRASH_CORE
+
 static ssize_t vmcoreinfo_show(struct kobject *kobj,
                               struct kobj_attribute *attr, char *buf)
 {
@@ -134,7 +138,7 @@ static ssize_t vmcoreinfo_show(struct kobject *kobj,
 }
 KERNEL_ATTR_RO(vmcoreinfo);
 
-#endif /* CONFIG_KEXEC_CORE */
+#endif /* CONFIG_CRASH_CORE */
 
 /* whether file capabilities are enabled */
 static ssize_t fscaps_show(struct kobject *kobj,
@@ -195,7 +199,7 @@ static ssize_t notes_read(struct file *filp, struct kobject *kobj,
        return count;
 }
 
-static struct bin_attribute notes_attr = {
+static struct bin_attribute notes_attr __ro_after_init  = {
        .attr = {
                .name = "notes",
                .mode = S_IRUGO,
@@ -219,6 +223,8 @@ static struct attribute * kernel_attrs[] = {
        &kexec_loaded_attr.attr,
        &kexec_crash_loaded_attr.attr,
        &kexec_crash_size_attr.attr,
+#endif
+#ifdef CONFIG_CRASH_CORE
        &vmcoreinfo_attr.attr,
 #endif
 #ifndef CONFIG_TINY_RCU