aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/fan.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/fan.c')
-rw-r--r--drivers/acpi/fan.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c
index 045c89477e59..f305a826ca2d 100644
--- a/drivers/acpi/fan.c
+++ b/drivers/acpi/fan.c
@@ -99,8 +99,8 @@ acpi_fan_write_state(struct file *file, const char __user * buffer,
99 size_t count, loff_t * ppos) 99 size_t count, loff_t * ppos)
100{ 100{
101 int result = 0; 101 int result = 0;
102 struct seq_file *m = (struct seq_file *)file->private_data; 102 struct seq_file *m = file->private_data;
103 struct acpi_fan *fan = (struct acpi_fan *)m->private; 103 struct acpi_fan *fan = m->private;
104 char state_string[12] = { '\0' }; 104 char state_string[12] = { '\0' };
105 105
106 106
@@ -186,10 +186,9 @@ static int acpi_fan_add(struct acpi_device *device)
186 if (!device) 186 if (!device)
187 return -EINVAL; 187 return -EINVAL;
188 188
189 fan = kmalloc(sizeof(struct acpi_fan), GFP_KERNEL); 189 fan = kzalloc(sizeof(struct acpi_fan), GFP_KERNEL);
190 if (!fan) 190 if (!fan)
191 return -ENOMEM; 191 return -ENOMEM;
192 memset(fan, 0, sizeof(struct acpi_fan));
193 192
194 fan->device = device; 193 fan->device = device;
195 strcpy(acpi_device_name(device), "Fan"); 194 strcpy(acpi_device_name(device), "Fan");
@@ -229,7 +228,7 @@ static int acpi_fan_remove(struct acpi_device *device, int type)
229 if (!device || !acpi_driver_data(device)) 228 if (!device || !acpi_driver_data(device))
230 return -EINVAL; 229 return -EINVAL;
231 230
232 fan = (struct acpi_fan *)acpi_driver_data(device); 231 fan = acpi_driver_data(device);
233 232
234 acpi_fan_remove_fs(device); 233 acpi_fan_remove_fs(device);
235 234