X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fhwmon%2Fasb100.c;h=52c469722a6584ea622618dbd99c6c53ff43b329;hb=fcda46128d5cb50075339b79ce585ab767337e9e;hp=8e34855a627406200510db53dd9e374d87ce7db9;hpb=0481990b758628e12f4b0a9e15094e70cefc7cd1;p=linux-2.6 diff --git a/drivers/hwmon/asb100.c b/drivers/hwmon/asb100.c index 8e34855a62..52c469722a 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, int i, id, err; struct asb100_data *data = i2c_get_clientdata(new_client); - data->lm75[0] = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); + data->lm75[0] = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); if (!(data->lm75[0])) { err = -ENOMEM; goto ERROR_SC_0; } - memset(data->lm75[0], 0x00, sizeof(struct i2c_client)); - data->lm75[1] = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); + data->lm75[1] = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); if (!(data->lm75[1])) { err = -ENOMEM; goto ERROR_SC_1; } - memset(data->lm75[1], 0x00, sizeof(struct i2c_client)); id = i2c_adapter_id(adapter); @@ -724,12 +722,11 @@ static int asb100_detect(struct i2c_adapter *adapter, int address, int kind) client structure, even though we cannot fill it completely yet. But it allows us to access asb100_{read,write}_value. */ - if (!(data = kmalloc(sizeof(struct asb100_data), GFP_KERNEL))) { - pr_debug("asb100.o: detect failed, kmalloc failed!\n"); + if (!(data = kzalloc(sizeof(struct asb100_data), GFP_KERNEL))) { + pr_debug("asb100.o: detect failed, kzalloc failed!\n"); err = -ENOMEM; goto ERROR0; } - memset(data, 0, sizeof(struct asb100_data)); new_client = &data->client; init_MUTEX(&data->lock);