Changeset 2445 for lm-sensors/trunk/kernel/chips/adm1026.c
- Timestamp:
- 04/17/04 19:20:01 (9 years ago)
- Files:
-
- 1 modified
-
lm-sensors/trunk/kernel/chips/adm1026.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/trunk/kernel/chips/adm1026.c
r2349 r2445 299 299 300 300 struct adm1026_data { 301 struct i2c_client client; 301 302 struct semaphore lock; 302 303 int sysctl_id; … … 638 639 But it allows us to access adm1026_{read,write}_value. */ 639 640 640 if (!(new_client = kmalloc((sizeof(struct i2c_client)) + 641 sizeof(struct adm1026_data), 642 GFP_KERNEL))) { 641 if (!(data = kmalloc(sizeof(struct adm1026_data), GFP_KERNEL))) { 643 642 err = -ENOMEM; 644 643 goto ERROR0; 645 644 } 646 645 647 data = (struct adm1026_data *) (new_client + 1);646 new_client = &data->client; 648 647 new_client->addr = address; 649 648 new_client->data = data; … … 768 767 i2c_detach_client(new_client); 769 768 ERROR1: 770 kfree( new_client);769 kfree(data); 771 770 ERROR0: 772 771 return err; … … 787 786 } 788 787 789 kfree(client );788 kfree(client->data); 790 789 791 790 return 0;
