diff options
Diffstat (limited to 'net/rfkill/core.c')
-rw-r--r-- | net/rfkill/core.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/rfkill/core.c b/net/rfkill/core.c index b41e9ea2ffff..f53bf3b6558b 100644 --- a/net/rfkill/core.c +++ b/net/rfkill/core.c | |||
@@ -49,7 +49,6 @@ | |||
49 | struct rfkill { | 49 | struct rfkill { |
50 | spinlock_t lock; | 50 | spinlock_t lock; |
51 | 51 | ||
52 | const char *name; | ||
53 | enum rfkill_type type; | 52 | enum rfkill_type type; |
54 | 53 | ||
55 | unsigned long state; | 54 | unsigned long state; |
@@ -73,6 +72,7 @@ struct rfkill { | |||
73 | struct delayed_work poll_work; | 72 | struct delayed_work poll_work; |
74 | struct work_struct uevent_work; | 73 | struct work_struct uevent_work; |
75 | struct work_struct sync_work; | 74 | struct work_struct sync_work; |
75 | char name[]; | ||
76 | }; | 76 | }; |
77 | #define to_rfkill(d) container_of(d, struct rfkill, dev) | 77 | #define to_rfkill(d) container_of(d, struct rfkill, dev) |
78 | 78 | ||
@@ -876,14 +876,14 @@ struct rfkill * __must_check rfkill_alloc(const char *name, | |||
876 | if (WARN_ON(type == RFKILL_TYPE_ALL || type >= NUM_RFKILL_TYPES)) | 876 | if (WARN_ON(type == RFKILL_TYPE_ALL || type >= NUM_RFKILL_TYPES)) |
877 | return NULL; | 877 | return NULL; |
878 | 878 | ||
879 | rfkill = kzalloc(sizeof(*rfkill), GFP_KERNEL); | 879 | rfkill = kzalloc(sizeof(*rfkill) + strlen(name) + 1, GFP_KERNEL); |
880 | if (!rfkill) | 880 | if (!rfkill) |
881 | return NULL; | 881 | return NULL; |
882 | 882 | ||
883 | spin_lock_init(&rfkill->lock); | 883 | spin_lock_init(&rfkill->lock); |
884 | INIT_LIST_HEAD(&rfkill->node); | 884 | INIT_LIST_HEAD(&rfkill->node); |
885 | rfkill->type = type; | 885 | rfkill->type = type; |
886 | rfkill->name = name; | 886 | strcpy(rfkill->name, name); |
887 | rfkill->ops = ops; | 887 | rfkill->ops = ops; |
888 | rfkill->data = ops_data; | 888 | rfkill->data = ops_data; |
889 | 889 | ||