aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/asb100.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwmon/asb100.c')
-rw-r--r--drivers/hwmon/asb100.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/hwmon/asb100.c b/drivers/hwmon/asb100.c
index 8e34855a6274..52c469722a65 100644
--- a/drivers/hwmon/asb100.c
+++ b/drivers/hwmon/asb100.c
@@ -629,19 +629,17 @@ static int asb100_detect_subclients(struct i2c_adapter *adapter, int address,
629 int i, id, err; 629 int i, id, err;
630 struct asb100_data *data = i2c_get_clientdata(new_client); 630 struct asb100_data *data = i2c_get_clientdata(new_client);
631 631
632 data->lm75[0] = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); 632 data->lm75[0] = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
633 if (!(data->lm75[0])) { 633 if (!(data->lm75[0])) {
634 err = -ENOMEM; 634 err = -ENOMEM;
635 goto ERROR_SC_0; 635 goto ERROR_SC_0;
636 } 636 }
637 memset(data->lm75[0], 0x00, sizeof(struct i2c_client));
638 637
639 data->lm75[1] = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); 638 data->lm75[1] = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
640 if (!(data->lm75[1])) { 639 if (!(data->lm75[1])) {
641 err = -ENOMEM; 640 err = -ENOMEM;
642 goto ERROR_SC_1; 641 goto ERROR_SC_1;
643 } 642 }
644 memset(data->lm75[1], 0x00, sizeof(struct i2c_client));
645 643
646 id = i2c_adapter_id(adapter); 644 id = i2c_adapter_id(adapter);
647 645
@@ -724,12 +722,11 @@ static int asb100_detect(struct i2c_adapter *adapter, int address, int kind)
724 client structure, even though we cannot fill it completely yet. 722 client structure, even though we cannot fill it completely yet.
725 But it allows us to access asb100_{read,write}_value. */ 723 But it allows us to access asb100_{read,write}_value. */
726 724
727 if (!(data = kmalloc(sizeof(struct asb100_data), GFP_KERNEL))) { 725 if (!(data = kzalloc(sizeof(struct asb100_data), GFP_KERNEL))) {
728 pr_debug("asb100.o: detect failed, kmalloc failed!\n"); 726 pr_debug("asb100.o: detect failed, kzalloc failed!\n");
729 err = -ENOMEM; 727 err = -ENOMEM;
730 goto ERROR0; 728 goto ERROR0;
731 } 729 }
732 memset(data, 0, sizeof(struct asb100_data));
733 730
734 new_client = &data->client; 731 new_client = &data->client;
735 init_MUTEX(&data->lock); 732 init_MUTEX(&data->lock);