Changeset 2445
- Timestamp:
- 04/17/04 19:20:01 (9 years ago)
- Location:
- lm-sensors/trunk/kernel/chips
- Files:
-
- 45 modified
-
adm1021.c (modified) (5 diffs)
-
adm1024.c (modified) (4 diffs)
-
adm1025.c (modified) (4 diffs)
-
adm1026.c (modified) (4 diffs)
-
adm9240.c (modified) (4 diffs)
-
bt869.c (modified) (4 diffs)
-
ddcmon.c (modified) (4 diffs)
-
ds1621.c (modified) (4 diffs)
-
eeprom.c (modified) (4 diffs)
-
fscher.c (modified) (4 diffs)
-
fscpos.c (modified) (4 diffs)
-
fscscy.c (modified) (4 diffs)
-
gl518sm.c (modified) (4 diffs)
-
gl520sm.c (modified) (4 diffs)
-
icspll.c (modified) (5 diffs)
-
it87.c (modified) (4 diffs)
-
lm75.c (modified) (4 diffs)
-
lm78.c (modified) (4 diffs)
-
lm80.c (modified) (4 diffs)
-
lm83.c (modified) (5 diffs)
-
lm85.c (modified) (4 diffs)
-
lm87.c (modified) (4 diffs)
-
lm90.c (modified) (5 diffs)
-
lm92.c (modified) (7 diffs)
-
ltc1710.c (modified) (4 diffs)
-
matorb.c (modified) (4 diffs)
-
max6650.c (modified) (5 diffs)
-
maxilife.c (modified) (5 diffs)
-
mtp008.c (modified) (4 diffs)
-
pc87360.c (modified) (4 diffs)
-
pca9540.c (modified) (4 diffs)
-
pcf8574.c (modified) (4 diffs)
-
pcf8591.c (modified) (4 diffs)
-
saa1064.c (modified) (4 diffs)
-
sis5595.c (modified) (4 diffs)
-
smartbatt.c (modified) (4 diffs)
-
smbus-arp.c (modified) (4 diffs)
-
smsc47m1.c (modified) (4 diffs)
-
thmc50.c (modified) (4 diffs)
-
via686a.c (modified) (4 diffs)
-
vt1211.c (modified) (4 diffs)
-
vt8231.c (modified) (4 diffs)
-
w83627hf.c (modified) (4 diffs)
-
w83l785ts.c (modified) (5 diffs)
-
xeontemp.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/trunk/kernel/chips/adm1021.c
r2395 r2445 87 87 /* Each client has this additional data */ 88 88 struct adm1021_data { 89 struct i2c_client client; 89 90 int sysctl_id; 90 91 enum chips type; … … 212 213 But it allows us to access adm1021_{read,write}_value. */ 213 214 214 if (!(new_client = kmalloc(sizeof(struct i2c_client) + 215 sizeof(struct adm1021_data), 216 GFP_KERNEL))) { 215 if (!(data = kmalloc(sizeof(struct adm1021_data), GFP_KERNEL))) { 217 216 err = -ENOMEM; 218 217 goto error0; 219 218 } 220 219 221 data = (struct adm1021_data *) (new_client + 1);220 new_client = &data->client; 222 221 new_client->addr = address; 223 222 new_client->data = data; … … 322 321 error3: 323 322 error1: 324 kfree( new_client);323 kfree(data); 325 324 error0: 326 325 return err; … … 338 337 static int adm1021_detach_client(struct i2c_client *client) 339 338 { 340 341 339 int err; 342 340 … … 350 348 } 351 349 352 kfree(client );350 kfree(client->data); 353 351 354 352 return 0; 355 356 353 } 357 354 -
lm-sensors/trunk/kernel/chips/adm1024.c
r2386 r2445 149 149 allocated. */ 150 150 struct adm1024_data { 151 struct i2c_client client; 151 152 int sysctl_id; 152 153 enum chips type; … … 326 327 But it allows us to access adm1024_{read,write}_value. */ 327 328 328 if (!(new_client = kmalloc(sizeof(struct i2c_client) + 329 sizeof(struct adm1024_data), 330 GFP_KERNEL))) { 329 if (!(data = kmalloc(sizeof(struct adm1024_data), GFP_KERNEL))) { 331 330 err = -ENOMEM; 332 331 goto ERROR0; 333 332 } 334 333 335 data = (struct adm1024_data *) (new_client + 1);334 new_client = &data->client; 336 335 new_client->addr = address; 337 336 new_client->data = data; … … 405 404 ERROR3: 406 405 ERROR1: 407 kfree( new_client);406 kfree(data); 408 407 ERROR0: 409 408 return err; … … 423 422 } 424 423 425 kfree(client );424 kfree(client->data); 426 425 427 426 return 0; 428 429 427 } 430 428 -
lm-sensors/trunk/kernel/chips/adm1025.c
r2386 r2445 118 118 allocated. */ 119 119 struct adm1025_data { 120 struct i2c_client client; 120 121 int sysctl_id; 121 122 enum chips type; … … 260 261 But it allows us to access adm1025_{read,write}_value. */ 261 262 262 if (!(new_client = kmalloc(sizeof(struct i2c_client) + 263 sizeof(struct adm1025_data), 264 GFP_KERNEL))) { 263 if (!(data = kmalloc(sizeof(struct adm1025_data), GFP_KERNEL))) { 265 264 err = -ENOMEM; 266 265 goto ERROR0; 267 266 } 268 267 269 data = (struct adm1025_data *) (new_client + 1);268 new_client = &data->client; 270 269 new_client->addr = address; 271 270 new_client->data = data; … … 351 350 ERROR3: 352 351 ERROR1: 353 kfree( new_client);352 kfree(data); 354 353 ERROR0: 355 354 return err; … … 369 368 } 370 369 371 kfree(client );370 kfree(client->data); 372 371 373 372 return 0; 374 375 373 } 376 374 -
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; -
lm-sensors/trunk/kernel/chips/adm9240.c
r2386 r2445 165 165 allocated. */ 166 166 struct adm9240_data { 167 struct i2c_client client; 167 168 int sysctl_id; 168 169 enum chips type; … … 324 325 But it allows us to access adm9240_{read,write}_value. */ 325 326 326 if (!(new_client = kmalloc(sizeof(struct i2c_client) + 327 sizeof(struct adm9240_data), 328 GFP_KERNEL))) { 327 if (!(data = kmalloc(sizeof(struct adm9240_data), GFP_KERNEL))) { 329 328 err = -ENOMEM; 330 329 goto ERROR0; 331 330 } 332 331 333 data = (struct adm9240_data *) (new_client + 1); 332 333 new_client = &data->client; 334 334 new_client->addr = address; 335 335 new_client->data = data; … … 418 418 ERROR3: 419 419 ERROR1: 420 kfree( new_client);420 kfree(data); 421 421 ERROR0: 422 422 return err; … … 436 436 } 437 437 438 kfree(client );438 kfree(client->data); 439 439 440 440 return 0; 441 442 441 } 443 442 -
lm-sensors/trunk/kernel/chips/bt869.c
r1705 r2445 61 61 /* Each client has this additional data */ 62 62 struct bt869_data { 63 struct i2c_client client; 63 64 int sysctl_id; 64 65 … … 504 505 client structure, even though we cannot fill it completely yet. 505 506 But it allows us to access bt869_{read,write}_value. */ 506 if (!(new_client = kmalloc(sizeof(struct i2c_client) + 507 sizeof(struct bt869_data), 508 GFP_KERNEL))) { 507 if (!(data = kmalloc(sizeof(struct bt869_data), GFP_KERNEL))) { 509 508 err = -ENOMEM; 510 509 goto ERROR0; 511 510 } 512 511 513 data = 514 (struct bt869_data *) (((struct i2c_client *) new_client) + 1); 512 new_client = &data->client; 515 513 new_client->addr = address; 516 514 new_client->data = data; … … 568 566 ERROR3: 569 567 ERROR1: 570 kfree( new_client);568 kfree(data); 571 569 ERROR0: 572 570 return err; … … 586 584 } 587 585 588 kfree(client );586 kfree(client->data); 589 587 590 588 return 0; -
lm-sensors/trunk/kernel/chips/ddcmon.c
r2410 r2445 75 75 /* Each client has this additional data */ 76 76 struct ddcmon_data { 77 struct i2c_client client; 77 78 int sysctl_id; 78 79 … … 216 217 client structure, even though we cannot fill it completely yet. 217 218 But it allows us to access ddcmon_{read,write}_value. */ 218 if (!(new_client = kmalloc(sizeof(struct i2c_client) + 219 sizeof(struct ddcmon_data), 220 GFP_KERNEL))) { 219 if (!(data = kmalloc(sizeof(struct ddcmon_data), GFP_KERNEL))) { 221 220 err = -ENOMEM; 222 221 goto ERROR0; 223 222 } 224 223 225 data = (struct ddcmon_data *) (new_client + 1);224 new_client = &data->client; 226 225 memset(data->data, 0xff, DDCMON_SIZE); 227 226 new_client->addr = address; … … 284 283 ERROR3: 285 284 ERROR1: 286 kfree( new_client);285 kfree(data); 287 286 ERROR0: 288 287 return err; … … 300 299 return err; 301 300 } 302 kfree(client );301 kfree(client->data); 303 302 return 0; 304 303 } -
lm-sensors/trunk/kernel/chips/ds1621.c
r2437 r2445 81 81 /* Each client has this additional data */ 82 82 struct ds1621_data { 83 struct i2c_client client; 83 84 int sysctl_id; 84 85 … … 190 191 client structure, even though we cannot fill it completely yet. 191 192 But it allows us to access ds1621_{read,write}_value. */ 192 if (!(new_client = kmalloc(sizeof(struct i2c_client) + 193 sizeof(struct ds1621_data), 194 GFP_KERNEL))) { 193 if (!(data = kmalloc(sizeof(struct ds1621_data), GFP_KERNEL))) { 195 194 err = -ENOMEM; 196 195 goto ERROR0; 197 196 } 198 197 199 data = (struct ds1621_data *) (new_client + 1);198 new_client = &data->client; 200 199 new_client->addr = address; 201 200 new_client->data = data; … … 257 256 ERROR3: 258 257 ERROR1: 259 kfree( new_client);258 kfree(data); 260 259 ERROR0: 261 260 return err; … … 275 274 } 276 275 277 kfree(client );276 kfree(client->data); 278 277 279 278 return 0; -
lm-sensors/trunk/kernel/chips/eeprom.c
r2401 r2445 64 64 /* Each client has this additional data */ 65 65 struct eeprom_data { 66 struct i2c_client client; 66 67 int sysctl_id; 67 68 … … 195 196 client structure, even though we cannot fill it completely yet. 196 197 But it allows us to access eeprom_{read,write}_value. */ 197 if (!(new_client = kmalloc(sizeof(struct i2c_client) + 198 sizeof(struct eeprom_data), 199 GFP_KERNEL))) { 198 if (!(data = kmalloc(sizeof(struct eeprom_data), GFP_KERNEL))) { 200 199 err = -ENOMEM; 201 200 goto ERROR0; 202 201 } 203 202 204 data = (struct eeprom_data *) (new_client + 1);203 new_client = &data->client; 205 204 memset(data->data, 0xff, EEPROM_SIZE); 206 205 new_client->addr = address; … … 279 278 ERROR3: 280 279 ERROR1: 281 kfree( new_client);280 kfree(data); 282 281 ERROR0: 283 282 return err; … … 297 296 } 298 297 299 kfree(client );298 kfree(client->data); 300 299 301 300 return 0; -
lm-sensors/trunk/kernel/chips/fscher.c
r2298 r2445 109 109 allocated. */ 110 110 struct fscher_data { 111 struct i2c_client client; 111 112 int sysctl_id; 112 113 … … 267 268 client structure, even though we cannot fill it completely yet. 268 269 But it allows us to access fscher_{read,write}_value. */ 269 if (!(new_client = kmalloc(sizeof(struct i2c_client) + 270 sizeof(struct fscher_data), 271 GFP_KERNEL))) { 270 if (!(data = kmalloc(sizeof(struct fscher_data), GFP_KERNEL))) { 272 271 err = -ENOMEM; 273 272 goto ERROR0; 274 273 } 275 274 276 data = (struct fscher_data *) (new_client + 1);275 new_client = &data->client; 277 276 new_client->addr = address; 278 277 new_client->data = data; … … 325 324 ERROR3: 326 325 ERROR1: 327 kfree( new_client);326 kfree(data); 328 327 ERROR0: 329 328 return err; … … 341 340 } 342 341 343 kfree(client );342 kfree(client->data); 344 343 345 344 return 0; -
lm-sensors/trunk/kernel/chips/fscpos.c
r2286 r2445 113 113 allocated. */ 114 114 struct fscpos_data { 115 struct i2c_client client; 115 116 int sysctl_id; 116 117 … … 251 252 client structure, even though we cannot fill it completely yet. 252 253 But it allows us to access fscpos_{read,write}_value. */ 253 if (!(new_client = kmalloc(sizeof(struct i2c_client) + 254 sizeof(struct fscpos_data), 255 GFP_KERNEL))) { 254 if (!(data = kmalloc(sizeof(struct fscpos_data), GFP_KERNEL))) { 256 255 err = -ENOMEM; 257 256 goto ERROR0; 258 257 } 259 258 260 data = (struct fscpos_data *) (new_client + 1);259 new_client = &data->client; 261 260 new_client->addr = address; 262 261 new_client->data = data; … … 308 307 ERROR3: 309 308 ERROR1: 310 kfree( new_client);309 kfree(data); 311 310 ERROR0: 312 311 return err; … … 326 325 } 327 326 328 kfree(client );327 kfree(client->data); 329 328 330 329 return 0; -
lm-sensors/trunk/kernel/chips/fscscy.c
r2286 r2445 157 157 allocated. */ 158 158 struct fscscy_data { 159 struct i2c_client client; 159 160 int sysctl_id; 160 161 … … 330 331 client structure, even though we cannot fill it completely yet. 331 332 But it allows us to access fscscy_{read,write}_value. */ 332 if (!(new_client = kmalloc(sizeof(struct i2c_client) + 333 sizeof(struct fscscy_data), 334 GFP_KERNEL))) { 333 if (!(data = kmalloc(sizeof(struct fscscy_data), GFP_KERNEL))) { 335 334 err = -ENOMEM; 336 335 goto ERROR0; 337 336 } 338 337 339 data = (struct fscscy_data *) (new_client + 1);338 new_client = &data->client; 340 339 new_client->addr = address; 341 340 new_client->data = data; … … 387 386 ERROR3: 388 387 ERROR1: 389 kfree( new_client);388 kfree(data); 390 389 ERROR0: 391 390 return err; … … 405 404 } 406 405 407 kfree(client );406 kfree(client->data); 408 407 409 408 return 0; -
lm-sensors/trunk/kernel/chips/gl518sm.c
r2437 r2445 112 112 /* Each client has this additional data */ 113 113 struct gl518_data { 114 struct i2c_client client; 114 115 int sysctl_id; 115 116 enum chips type; … … 279 280 But it allows us to access gl518_{read,write}_value. */ 280 281 281 if (!(new_client = kmalloc(sizeof(struct i2c_client) + 282 sizeof(struct gl518_data), 283 GFP_KERNEL))) { 282 if (!(data = kmalloc(sizeof(struct gl518_data), GFP_KERNEL))) { 284 283 err = -ENOMEM; 285 284 goto ERROR0; 286 285 } 287 286 288 data = (struct gl518_data *) (new_client + 1);287 new_client = &data->client; 289 288 new_client->addr = address; 290 289 new_client->data = data; … … 389 388 ERROR2: 390 389 ERROR1: 391 kfree( new_client);390 kfree(data); 392 391 ERROR0: 393 392 return err; … … 441 440 } 442 441 443 kfree(client );442 kfree(client->data); 444 443 445 444 return 0; -
lm-sensors/trunk/kernel/chips/gl520sm.c
r2437 r2445 117 117 /* Each client has this additional data */ 118 118 struct gl520_data { 119 struct i2c_client client; 119 120 int sysctl_id; 120 121 enum chips type; … … 283 284 But it allows us to access gl520_{read,write}_value. */ 284 285 285 if (!(new_client = kmalloc(sizeof(struct i2c_client) + 286 sizeof(struct gl520_data), 287 GFP_KERNEL))) { 286 if (!(data = kmalloc(sizeof(struct gl520_data), GFP_KERNEL))) { 288 287 err = -ENOMEM; 289 288 goto ERROR0; 290 289 } 291 290 292 data = (struct gl520_data *) (new_client + 1);291 new_client = &data->client; 293 292 new_client->addr = address; 294 293 new_client->data = data; … … 355 354 ERROR3: 356 355 ERROR1: 357 kfree( new_client);356 kfree(data); 358 357 ERROR0: 359 358 return err; … … 392 391 } 393 392 394 kfree(client );393 kfree(client->data); 395 394 396 395 return 0; -
lm-sensors/trunk/kernel/chips/icspll.c
r1705 r2445 54 54 /* Each client has this additional data */ 55 55 struct icspll_data { 56 struct i2c_client client; 56 57 int sysctl_id; 57 58 struct semaphore update_lock; … … 134 135 135 136 /* Allocate space for a new client structure */ 136 if (!(new_client = kmalloc(sizeof(struct i2c_client) + 137 sizeof(struct icspll_data), 138 GFP_KERNEL))) { 137 if (!(data = kmalloc(sizeof(struct icspll_data), GFP_KERNEL))) { 139 138 err = -ENOMEM; 140 139 goto ERROR0; … … 142 141 143 142 /* Fill the new client structure with data */ 144 data = (struct icspll_data *) (new_client + 1);143 new_data = &data->client; 145 144 new_client->data = data; 146 145 new_client->id = icspll_id++; … … 179 178 ERROR2: 180 179 ERROR1: 181 kfree( new_client);180 kfree(data); 182 181 ERROR0: 183 182 return err; … … 197 196 } 198 197 199 kfree(client );198 kfree(client->data); 200 199 return 0; 201 200 } -
lm-sensors/trunk/kernel/chips/it87.c
r2431 r2445 224 224 allocated. */ 225 225 struct it87_data { 226 struct i2c_client client; 226 227 struct semaphore lock; 227 228 int sysctl_id; … … 499 500 But it allows us to access it87_{read,write}_value. */ 500 501 501 if (!(new_client = kmalloc((sizeof(struct i2c_client)) + 502 sizeof(struct it87_data), 503 GFP_KERNEL))) { 502 if (!(data = kmalloc(sizeof(struct it87_data), GFP_KERNEL))) { 504 503 err = -ENOMEM; 505 504 goto ERROR0; 506 505 } 507 506 508 data = (struct it87_data *) (new_client + 1);507 new_client = &data->client; 509 508 if (is_isa) 510 509 init_MUTEX(&data->lock); … … 595 594 release_region(address, IT87_EXTENT); 596 595 ERROR1: 597 kfree( new_client);596 kfree(data); 598 597 ERROR0: 599 598 return err; … … 615 614 if(i2c_is_isa_client(client)) 616 615 release_region(client->addr, IT87_EXTENT); 617 kfree(client );616 kfree(client->data); 618 617 619 618 return 0; -
lm-sensors/trunk/kernel/chips/lm75.c
r2437 r2445 46 46 /* Each client has this additional data */ 47 47 struct lm75_data { 48 struct i2c_client client; 48 49 int sysctl_id; 49 50 … … 129 130 client structure, even though we cannot fill it completely yet. 130 131 But it allows us to access lm75_{read,write}_value. */ 131 if (!(new_client = kmalloc(sizeof(struct i2c_client) + 132 sizeof(struct lm75_data), 133 GFP_KERNEL))) { 132 if (!(data = kmalloc(sizeof(struct lm75_data), GFP_KERNEL))) { 134 133 err = -ENOMEM; 135 134 goto error0; 136 135 } 137 136 138 data = (struct lm75_data *) (new_client + 1);137 new_client = &data->client; 139 138 new_client->addr = address; 140 139 new_client->data = data; … … 203 202 error3: 204 203 error1: 205 kfree( new_client);204 kfree(data); 206 205 error0: 207 206 return err; … … 214 213 i2c_deregister_entry(data->sysctl_id); 215 214 i2c_detach_client(client); 216 kfree(client );215 kfree(client->data); 217 216 return 0; 218 217 } -
lm-sensors/trunk/kernel/chips/lm78.c
r2286 r2445 119 119 allocated. */ 120 120 struct lm78_data { 121 struct i2c_client client; 121 122 struct semaphore lock; 122 123 int sysctl_id; … … 313 314 But it allows us to access lm78_{read,write}_value. */ 314 315 315 if (!(new_client = kmalloc((sizeof(struct i2c_client)) + 316 sizeof(struct lm78_data), 317 GFP_KERNEL))) { 316 if (!(data = kmalloc(sizeof(struct lm78_data), GFP_KERNEL))) { 318 317 err = -ENOMEM; 319 318 goto ERROR0; 320 319 } 321 320 322 data = (struct lm78_data *) (new_client + 1);321 new_client = &data->client; 323 322 if (is_isa) 324 323 init_MUTEX(&data->lock); … … 413 412 release_region(address, LM78_EXTENT); 414 413 ERROR1: 415 kfree( new_client);414 kfree(data); 416 415 ERROR0: 417 416 return err; … … 433 432 if(i2c_is_isa_client(client)) 434 433 release_region(client->addr, LM78_EXTENT); 435 kfree(client );434 kfree(client->data); 436 435 437 436 return 0; -
lm-sensors/trunk/kernel/chips/lm80.c
r2284 r2445 110 110 111 111 struct lm80_data { 112 struct i2c_client client; 112 113 int sysctl_id; 113 114 … … 262 263 client structure, even though we cannot fill it completely yet. 263 264 But it allows us to access lm80_{read,write}_value. */ 264 if (!(new_client = kmalloc(sizeof(struct i2c_client) + 265 sizeof(struct lm80_data), 266 GFP_KERNEL))) { 265 if (!(data = kmalloc(sizeof(struct lm80_data), GFP_KERNEL))) { 267 266 err = -ENOMEM; 268 267 goto ERROR0; 269 268 } 270 269 271 data = (struct lm80_data *) (new_client + 1);270 new_client = &data->client; 272 271 new_client->addr = address; 273 272 new_client->data = data; … … 331 330 ERROR3: 332 331 ERROR1: 333 kfree( new_client);332 kfree(data); 334 333 ERROR0: 335 334 return err; … … 349 348 } 350 349 351 kfree(client );350 kfree(client->data); 352 351 353 352 return 0; -
lm-sensors/trunk/kernel/chips/lm83.c
r2192 r2445 143 143 struct lm83_data 144 144 { 145 struct i2c_client client; 145 146 int sysctl_id; 146 147 … … 245 246 } 246 247 247 if (!(new_client = kmalloc(sizeof(struct i2c_client) + sizeof(struct 248 lm83_data), GFP_KERNEL))) 248 if (!(data = kmalloc(sizeof(struct lm83_data), GFP_KERNEL))) 249 249 { 250 250 printk("lm83.o: Out of memory in lm83_detect (new_client).\n"); … … 253 253 254 254 /* 255 * The LM83-specific data is placed right after the common I2C256 * client data, and is pointed to by the data field from the I2C257 * client data.255 * The common I2C client data is placed right before the 256 * LM83-specific data. The LM83-specific data is pointed to by the 257 * data field from the I2C client data. 258 258 */ 259 259 260 new_client = &data->client; 260 261 new_client->addr = address; 261 new_client->data = data = (struct lm83_data *) (new_client + 1);262 new_client->data = data; 262 263 new_client->adapter = adapter; 263 264 new_client->driver = &lm83_driver; … … 369 370 i2c_detach_client(new_client); 370 371 ERROR1: 371 kfree( new_client);372 kfree(data); 372 373 return err; 373 374 } … … 385 386 } 386 387 387 kfree(client );388 kfree(client->data); 388 389 return 0; 389 390 } -
lm-sensors/trunk/kernel/chips/lm85.c
r2286 r2445 385 385 386 386 struct lm85_data { 387 struct i2c_client client; 387 388 struct semaphore lock; 388 389 int sysctl_id; … … 739 740 But it allows us to access lm85_{read,write}_value. */ 740 741 741 if (!(new_client = kmalloc((sizeof(struct i2c_client)) + 742 sizeof(struct lm85_data), 743 GFP_KERNEL))) { 742 if (!(data = kmalloc(sizeof(struct lm85_data), GFP_KERNEL))) { 744 743 err = -ENOMEM; 745 744 goto ERROR0; 746 745 } 747 746 748 data = (struct lm85_data *) (new_client + 1);747 new_client = &data->client; 749 748 new_client->addr = address; 750 749 new_client->data = data; … … 922 921 i2c_detach_client(new_client); 923 922 ERROR1: 924 kfree( new_client);923 kfree(data); 925 924 ERROR0: 926 925 return err; … … 941 940 } 942 941 943 kfree(client );942 kfree(client->data); 944 943 945 944 return 0; -
lm-sensors/trunk/kernel/chips/lm87.c
r2386 r2445 196 196 allocated. */ 197 197 struct lm87_data { 198 struct i2c_client client; 198 199 int sysctl_id; 199 200 enum chips type; … … 418 419 But it allows us to access LM87_{read,write}_value. */ 419 420 420 if (!(new_client = kmalloc(sizeof(struct i2c_client) + 421 sizeof(struct lm87_data), 422 GFP_KERNEL))) { 421 if (!(data = kmalloc(sizeof(struct lm87_data), GFP_KERNEL))) { 423 422 err = -ENOMEM; 424 423 goto ERROR0; 425 424 } 426 425 427 data = (struct lm87_data *) (new_client + 1);426 new_client = &data->client; 428 427 new_client->addr = address; 429 428 new_client->data = data; … … 475 474 ERROR3: 476 475 ERROR1: 477 kfree( new_client);476 kfree(data); 478 477 ERROR0: 479 478 return err; … … 493 492 } 494 493 495 kfree(client );494 kfree(client->data); 496 495 497 496 return 0; 498 499 497 } 500 498 -
lm-sensors/trunk/kernel/chips/lm90.c
r2298 r2445 161 161 struct lm90_data 162 162 { 163 struct i2c_client client; 163 164 int sysctl_id; 164 165 … … 266 267 } 267 268 268 if (!(new_client = kmalloc(sizeof(struct i2c_client) + 269 sizeof(struct lm90_data), GFP_KERNEL))) 269 if (!(data = kmalloc(sizeof(struct lm90_data), GFP_KERNEL))) 270 270 { 271 271 printk("lm90.o: Out of memory in lm90_detect (new_client).\n"); … … 274 274 275 275 /* 276 * The LM90-specific data is placed right after the common I2C277 * client data, and is pointed to by the data field from the I2C278 * client data.276 * The common I2C client data is placed right before the 277 * LM90-specific data. The LM90-specific data is pointed to by the 278 * data field from the I2C client data. 279 279 */ 280 280 281 new_client = &data->client; 281 282 new_client->addr = address; 282 new_client->data = data = (struct lm90_data *) (new_client + 1);283 new_client->data = data; 283 284 new_client->adapter = adapter; 284 285 new_client->driver = &lm90_driver; … … 413 414 i2c_detach_client(new_client); 414 415 ERROR1: 415 kfree( new_client);416 kfree(data); 416 417 return err; 417 418 } … … 446 447 } 447 448 448 kfree(client );449 kfree(client->data); 449 450 return 0; 450 451 } -
lm-sensors/trunk/kernel/chips/lm92.c
r2440 r2445 84 84 /* NOTE: all temperatures are degrees centigrade * 16 */ 85 85 typedef struct { 86 struct i2c_client client; 86 87 int sysctl_id; 87 88 unsigned long timestamp; … … 308 309 return (-ENODEV); 309 310 310 if ( (client = kmalloc (sizeof (struct i2c_client) + sizeof (lm92_t),GFP_KERNEL)) == NULL)311 if (!(data = kmalloc(sizeof(lm92_t), GFP_KERNEL))) 311 312 return (-ENOMEM); 312 313 313 data = (lm92_t *) (client + 1);314 client = &data->client; 314 315 client->addr = address; 315 316 client->data = data; … … 320 321 321 322 if (down_interruptible (&mutex)) { 322 kfree (client);323 return (-ERESTARTSYS);323 result = -ERESTARTSYS; 324 goto ERROR1; 324 325 } 325 326 … … 331 332 /* Is it a MAX6635/MAX6635/MAX6635? */ 332 333 if (!max6635_check(client)) { 333 kfree (client); 334 up (&mutex); 335 return (-ENODEV); 334 result = -ENODEV; 335 goto ERROR2; 336 336 } 337 337 } … … 339 339 340 340 if ((result = i2c_attach_client (client))) { 341 kfree (client); 342 up (&mutex); 343 return (result); 341 goto ERROR2; 344 342 } 345 343 346 344 if ((result = i2c_register_entry (client,client->name,lm92_dir_table)) < 0) { 347 i2c_detach_client (client); 348 kfree (client); 349 up (&mutex); 350 return (result); 345 goto ERROR3; 351 346 } 352 347 data->sysctl_id = result; 353 348 354 349 if ((result = lm92_init_client (client)) < 0) { 355 i2c_deregister_entry (data->sysctl_id); 356 i2c_detach_client (client); 357 kfree (client); 358 up (&mutex); 359 return (result); 350 goto ERROR4; 360 351 } 361 352 … … 365 356 366 357 return (0); 358 359 ERROR4: 360 i2c_deregister_entry(data->sysctl_id); 361 ERROR3: 362 i2c_detach_client(client); 363 ERROR2: 364 up(&mutex); 365 ERROR1: 366 kfree(data); 367 return result; 367 368 } 368 369 … … 395 396 return (result); 396 397 397 kfree (client);398 kfree(client->data); 398 399 399 400 return (0); -
lm-sensors/trunk/kernel/chips/ltc1710.c
r2386 r2445 69 69 /* Each client has this additional data */ 70 70 struct ltc1710_data { 71 struct i2c_client client; 71 72 int sysctl_id; 72 73 … … 153 154 client structure, even though we cannot fill it completely yet. 154 155 But it allows us to access ltc1710_{read,write}_value. */ 155 if (!(new_client = kmalloc(sizeof(struct i2c_client) + 156 sizeof(struct ltc1710_data), 157 GFP_KERNEL))) { 156 if (!(data = kmalloc(sizeof(struct ltc1710_data), GFP_KERNEL))) { 158 157 err = -ENOMEM; 159 158 goto ERROR0; 160 159 } 161 160 162 data = (struct ltc1710_data *) (new_client + 1);161 new_client = &data->client; 163 162 new_client->addr = address; 164 163 new_client->data = data; … … 213 212 ERROR3: 214 213 ERROR1: 215 kfree( new_client);214 kfree(data); 216 215 ERROR0: 217 216 return err; … … 232 231 } 233 232 234 kfree(client );233 kfree(client->data); 235 234 236 235 return 0; -
lm-sensors/trunk/kernel/chips/matorb.c
r1705 r2445 46 46 /* Each client has this additional data */ 47 47 struct matorb_data { 48 struct i2c_client client; 48 49 int sysctl_id; 49 50 … … 128 129 client structure, even though we cannot fill it completely yet. 129 130 But it allows us to access matorb_{read,write}_value. */ 130 if (!(new_client = kmalloc(sizeof(struct i2c_client) + 131 sizeof(struct matorb_data), 132 GFP_KERNEL))) { 131 if (!(data = kmalloc(sizeof(struct matorb_data), GFP_KERNEL))) { 133 132 err = -ENOMEM; 134 133 goto ERROR0; 135 134 } 136 135 137 data = (struct matorb_data *) (new_client + 1);136 new_client = &data->client; 138 137 new_client->addr = address; 139 138 new_client->data = data; … … 175 174 i2c_detach_client(new_client); 176 175 ERROR3: 177 kfree( new_client);176 kfree(data); 178 177 ERROR0: 179 178 return err; … … 193 192 } 194 193 195 kfree(client );194 kfree(client->data); 196 195 197 196 return 0; -
lm-sensors/trunk/kernel/chips/max6650.c
r2298 r2445 129 129 struct max6650_data 130 130 { 131 struct i2c_client client; 131 132 int sysctl_id; 132 133 struct semaphore update_lock; … … 220 221 } 221 222 222 if (!(new_client = kmalloc(sizeof(struct i2c_client) + sizeof(struct 223 max6650_data), GFP_KERNEL))) { 223 if (!(data = kmalloc(sizeof(struct max6650_data), GFP_KERNEL))) { 224 224 printk("max6650.o: Out of memory in max6650_detect (new_client).\n"); 225 225 return -ENOMEM; … … 227 227 228 228 /* 229 * The max6650-specific data is placed right after the common I2C230 * client data, and is pointed to by the data field from the I2C231 *client data.229 * The common I2C client data is placed right before the 230 * max6650-specific data. The max6650-specific data is pointed to by the 231 * data field from the I2C client data. 232 232 */ 233 233 234 new_client = &data->client; 234 235 new_client->addr = address; 235 new_client->data = data = (struct max6650_data *) (new_client + 1);236 new_client->data = data; 236 237 new_client->adapter = adapter; 237 238 new_client->driver = &max6650_driver; … … 329 330 i2c_detach_client(new_client); 330 331 ERROR1: 331 kfree( new_client);332 kfree(data); 332 333 return err; 333 334 } … … 349 350 } 350 351 351 kfree(client );352 kfree(client->data); 352 353 return 0; 353 354 } -
lm-sensors/trunk/kernel/chips/maxilife.c
r2286 r2445 239 239 SMBus and not on the ISA bus. */ 240 240 struct maxi_data { 241 struct i2c_client client; 241 242 struct semaphore lock; 242 243 int sysctl_id; … … 440 441 client structure, even though we cannot fill it completely yet. 441 442 But it allows us to access maxi_{read,write}_value. */ 442 if (!(new_client = kmalloc(sizeof(struct i2c_client) + 443 sizeof(struct maxi_data), 444 GFP_KERNEL))) { 443 if (!(data = kmalloc(sizeof(struct maxi_data), GFP_KERNEL))) { 445 444 err = -ENOMEM; 446 445 goto ERROR0; … … 448 447 449 448 /* Fill the new client structure with data */ 450 data = (struct maxi_data *) (new_client + 1);449 new_client = &data->client; 451 450 new_client->addr = address; 452 451 new_client->data = data; … … 630 629 i2c_detach_client(new_client); 631 630 ERROR2: 632 kfree( new_client);631 kfree(data); 633 632 ERROR0: 634 633 return err; … … 651 650 return err; 652 651 } 653 kfree(client );652 kfree(client->data); 654 653 return 0; 655 654 } -
lm-sensors/trunk/kernel/chips/mtp008.c
r2286 r2445 194 194 */ 195 195 struct mtp008_data { 196 struct i2c_client client; 196 197 int sysctl_id; 197 198 enum chips type; … … 403 404 * allows us to use mtp008_(read|write)_value(). 404 405 */ 405 if (!(new_client = kmalloc(sizeof(struct i2c_client) + 406 sizeof(struct mtp008_data), 407 GFP_KERNEL))) { 406 if (!(data = kmalloc(sizeof(struct mtp008_data), GFP_KERNEL))) { 408 407 err = -ENOMEM; 409 408 goto ERROR0; 410 409 } 411 data = (struct mtp008_data *) (new_client + 1); 410 411 new_client = &data->client; 412 412 new_client->addr = address; 413 413 new_client->data = data; … … 464 464 i2c_detach_client(new_client); 465 465 ERROR1: 466 kfree( new_client);466 kfree(data); 467 467 468 468 ERROR0: … … 482 482 return err; 483 483 } 484 kfree(client );484 kfree(client->data); 485 485 486 486 return 0; -
lm-sensors/trunk/kernel/chips/pc87360.c
r2429 r2445 110 110 111 111 struct pc87360_data { 112 struct i2c_client client; 112 113 struct semaphore lock; 113 114 int sysctl_id; … … 277 278 } 278 279 279 if (!(new_client = kmalloc(sizeof(struct i2c_client) + 280 sizeof(struct pc87360_data), 281 GFP_KERNEL))) { 280 if (!(data = kmalloc(sizeof(struct pc87360_data), GFP_KERNEL))) { 282 281 return -ENOMEM; 283 282 } 284 283 285 data = (struct pc87360_data *) (new_client + 1);284 new_client = &data->client; 286 285 new_client->addr = address; 287 286 init_MUTEX(&data->lock); … … 338 337 ERROR1: 339 338 release_region(address, PC87360_EXTENT); 340 kfree( new_client);339 kfree(data); 341 340 return err; 342 341 } … … 355 354 356 355 release_region(client->addr, PC87360_EXTENT); 357 kfree(client );356 kfree(client->data); 358 357 359 358 return 0; -
lm-sensors/trunk/kernel/chips/pca9540.c
r2366 r2445 49 49 /* Each client has this additional data */ 50 50 struct pca9540_data { 51 struct i2c_client client; 51 52 int sysctl_id; 52 53 … … 108 109 /* OK. For now, we presume we have a valid client. We now create the 109 110 client structure, even though we cannot fill it completely yet. */ 110 if (!(new_client = kmalloc(sizeof(struct i2c_client) + 111 sizeof(struct pca9540_data), 112 GFP_KERNEL))) { 111 if (!(data = kmalloc(sizeof(struct pca9540_data), GFP_KERNEL))) { 113 112 err = -ENOMEM; 114 113 goto ERROR0; 115 114 } 116 115 117 data = (struct pca9540_data *) (new_client + 1);116 new_client = &data->client; 118 117 new_client->addr = address; 119 118 new_client->data = data; … … 160 159 i2c_detach_client(new_client); 161 160 ERROR1: 162 kfree( new_client);161 kfree(data); 163 162 ERROR0: 164 163 return err; … … 177 176 } 178 177 179 kfree(client );178 kfree(client->data); 180 179 181 180 return 0; 182 183 181 } 184 182 -
lm-sensors/trunk/kernel/chips/pcf8574.c
r2362 r2445 66 66 /* Each client has this additional data */ 67 67 struct pcf8574_data { 68 struct i2c_client client; 68 69 int sysctl_id; 69 70 … … 147 148 /* OK. For now, we presume we have a valid client. We now create the 148 149 client structure, even though we cannot fill it completely yet. */ 149 if (!(new_client = kmalloc(sizeof(struct i2c_client) + 150 sizeof(struct pcf8574_data), 151 GFP_KERNEL))) { 150 if (!(data = kmalloc(sizeof(struct pcf8574_data), GFP_KERNEL))) { 152 151 err = -ENOMEM; 153 152 goto ERROR0; 154 153 } 155 154 156 data = (struct pcf8574_data *) (new_client + 1);155 new_client = &data->client; 157 156 new_client->addr = address; 158 157 new_client->data = data; … … 208 207 i2c_detach_client(new_client); 209 208 ERROR1: 210 kfree( new_client);209 kfree(data); 211 210 ERROR0: 212 211 return err; … … 226 225 } 227 226 228 kfree(client );227 kfree(client->data); 229 228 230 229 return 0; 231 232 230 } 233 231 -
lm-sensors/trunk/kernel/chips/pcf8591.c
r2397 r2445 71 71 72 72 struct pcf8591_data { 73 struct i2c_client client; 73 74 int sysctl_id; 74 75 … … 184 185 /* OK. For now, we presume we have a valid client. We now create the 185 186 client structure, even though we cannot fill it completely yet. */ 186 if (!(new_client = kmalloc(sizeof(struct i2c_client) + 187 sizeof(struct pcf8591_data), 188 GFP_KERNEL))) { 187 if (!(data = kmalloc(sizeof(struct pcf8591_data), GFP_KERNEL))) { 189 188 err = -ENOMEM; 190 189 goto ERROR0; 191 190 } 192 191 193 data = (struct pcf8591_data *) (new_client + 1);192 new_client = &data->client; 194 193 new_client->addr = address; 195 194 new_client->data = data; … … 238 237 i2c_detach_client(new_client); 239 238 ERROR3: 240 kfree(new_client);239 kfree(data); 241 240 ERROR0: 242 241 return err; … … 256 255 } 257 256 258 kfree(client);257 kfree(client->data); 259 258 260 259 return 0; -
lm-sensors/trunk/kernel/chips/saa1064.c
r2386 r2445 122 122 /* Each client has this additional data */ 123 123 struct saa1064_data { 124 struct i2c_client client; 124 125 int sysctl_id; 125 126 … … 219 220 client structure, even though we cannot fill it completely yet. 220 221 But it allows us to access i2c_smbus_read_byte */ 221 if (!(new_client = kmalloc(sizeof(struct i2c_client) + 222 sizeof(struct saa1064_data), 223 GFP_KERNEL))) { 222 if (!(data = kmalloc(sizeof(struct saa1064_data), GFP_KERNEL))) { 224 223 err = -ENOMEM; 225 224 goto ERROR0; 226 225 } 227 226 228 data = (struct saa1064_data *) (new_client + 1);227 new_client = &data->client; 229 228 new_client->addr = address; 230 229 new_client->data = data; … … 280 279 i2c_detach_client(new_client); 281 280 ERROR3: 282 ERROR1:283 kfree( new_client);281 ERROR1: 282 kfree(data); 284 283 ERROR0: 285 284 return err; … … 300 299 } 301 300 302 kfree(client );301 kfree(client->data); 303 302 304 303 return 0; -
lm-sensors/trunk/kernel/chips/sis5595.c
r2286 r2445 171 171 allocated. */ 172 172 struct sis5595_data { 173 struct i2c_client client; 173 174 struct semaphore lock; 174 175 int sysctl_id; … … 387 388 } 388 389 389 if (!(new_client = kmalloc(sizeof(struct i2c_client) + 390 sizeof(struct sis5595_data), 391 GFP_KERNEL))) { 390 if (!(data = kmalloc(sizeof(struct sis5595_data), GFP_KERNEL))) { 392 391 return -ENOMEM; 393 392 } 394 393 395 data = (struct sis5595_data *) (new_client + 1);394 new_client = &data->client; 396 395 new_client->addr = address; 397 396 init_MUTEX(&data->lock); … … 446 445 ERROR3: 447 446 release_region(address, SIS5595_EXTENT); 448 kfree( new_client);447 kfree(data); 449 448 return err; 450 449 } … … 464 463 465 464 release_region(client->addr, SIS5595_EXTENT); 466 kfree(client );465 kfree(client->data); 467 466 468 467 return 0; -
lm-sensors/trunk/kernel/chips/smartbatt.c
r2437 r2445 73 73 /* Each client has this additional data */ 74 74 struct smartbatt_data { 75 struct i2c_client client; 75 76 int sysctl_id; 76 77 … … 244 245 client structure, even though we cannot fill it completely yet. 245 246 But it allows us to access smartbatt_{read,write}_value. */ 246 if (!(new_client = kmalloc(sizeof(struct i2c_client) + 247 sizeof(struct smartbatt_data), 248 GFP_KERNEL))) { 247 if (!(data = kmalloc(sizeof(struct smartbatt_data), GFP_KERNEL))) { 249 248 err = -ENOMEM; 250 249 goto ERROR0; 251 250 } 252 251 253 data = (struct smartbatt_data *) (new_client + 1);252 new_client = &data->client; 254 253 new_client->addr = address; 255 254 new_client->data = data; … … 298 297 ERROR3: 299 298 ERROR1: 300 kfree( new_client);299 kfree(data); 301 300 ERROR0: 302 301 return err; … … 316 315 } 317 316 318 kfree(client );317 kfree(client->data); 319 318 320 319 return 0; -
lm-sensors/trunk/kernel/chips/smbus-arp.c
r1802 r2445 106 106 /* Each client has this additional data */ 107 107 struct arp_data { 108 struct i2c_client client; 108 109 int sysctl_id; 109 110 … … 191 192 return(0); 192 193 193 if (!(new_client = kmalloc(sizeof(struct i2c_client) + 194 sizeof(struct arp_data), 195 GFP_KERNEL))) { 194 if (!(data = kmalloc(sizeof(struct arp_data), GFP_KERNEL))) { 196 195 return(-ENOMEM); 197 196 } 198 197 199 data = (struct arp_data *) (new_client + 1);198 new_client = &data->client; 200 199 new_client->addr = address; 201 200 new_client->data = data; … … 232 231 i2c_detach_client(new_client); 233 232 ERROR1: 234 kfree( new_client);233 kfree(data); 235 234 return err; 236 235 } … … 249 248 } 250 249 251 kfree(client );250 kfree(client->data); 252 251 253 252 return 0; -
lm-sensors/trunk/kernel/chips/smsc47m1.c
r2363 r2445 122 122 123 123 struct smsc47m1_data { 124 struct i2c_client client; 124 125 struct semaphore lock; 125 126 int sysctl_id; … … 260 261 } 261 262 262 if (!(new_client = kmalloc(sizeof(struct i2c_client) + 263 sizeof(struct smsc47m1_data), 264 GFP_KERNEL))) { 263 if (!(data = kmalloc(sizeof(struct smsc47m1_data), GFP_KERNEL))) { 265 264 return -ENOMEM; 266 265 } 267 266 268 data = (struct smsc47m1_data *) (new_client + 1);267 new_client = &data->client; 269 268 new_client->addr = address; 270 269 init_MUTEX(&data->lock); … … 299 298 ERROR3: 300 299 release_region(address, SMSC_EXTENT); 301 kfree( new_client);300 kfree(data); 302 301 return err; 303 302 } … … 317 316 318 317 release_region(client->addr, SMSC_EXTENT); 319 kfree(client );318 kfree(client->data); 320 319 321 320 return 0; -
lm-sensors/trunk/kernel/chips/thmc50.c
r2434 r2445 74 74 /* Each client has this additional data */ 75 75 struct thmc50_data { 76 struct i2c_client client; 76 77 int sysctl_id; 77 78 … … 191 192 client structure, even though we cannot fill it completely yet. 192 193 But it allows us to access thmc50_{read,write}_value. */ 193 if (!(new_client = kmalloc(sizeof(struct i2c_client) + 194 sizeof(struct thmc50_data), 195 GFP_KERNEL))) { 194 if (!(data = kmalloc(sizeof(struct thmc50_data), GFP_KERNEL))) { 196 195 err = -ENOMEM; 197 196 goto ERROR0; 198 197 } 199 198 200 data = 201 (struct thmc50_data *) (((struct i2c_client *) new_client) + 202 1); 199 new_client = &data->client; 203 200 new_client->addr = address; 204 201 new_client->data = data; … … 263 260 ERROR3: 264 261 ERROR1: 265 kfree( new_client);262 kfree(data); 266 263 ERROR0: 267 264 return err; … … 281 278 } 282 279 283 kfree(client );280 kfree(client->data); 284 281 285 282 return 0; -
lm-sensors/trunk/kernel/chips/via686a.c
r2436 r2445 335 335 via686a client is allocated. */ 336 336 struct via686a_data { 337 struct i2c_client client; 337 338 struct semaphore lock; 338 339 int sysctl_id; … … 517 518 } 518 519 519 if (!(new_client = kmalloc(sizeof(struct i2c_client) + 520 sizeof(struct via686a_data), 521 GFP_KERNEL))) { 520 if (!(data = kmalloc(sizeof(struct via686a_data), GFP_KERNEL))) { 522 521 err = -ENOMEM; 523 522 goto ERROR0; 524 523 } 525 524 526 data = (struct via686a_data *) (new_client + 1);525 new_client = &data->client; 527 526 new_client->addr = address; 528 527 init_MUTEX(&data->lock); … … 563 562 ERROR3: 564 563 release_region(address, VIA686A_EXTENT); 565 kfree( new_client);564 kfree(data); 566 565 ERROR0: 567 566 return err; … … 582 581 583 582 release_region(client->addr, VIA686A_EXTENT); 584 kfree(client );583 kfree(client->data); 585 584 586 585 return 0; -
lm-sensors/trunk/kernel/chips/vt1211.c
r2304 r2445 176 176 177 177 struct vt1211_data { 178 struct i2c_client client; 178 179 struct semaphore lock; 179 180 int sysctl_id; … … 410 411 superio_exit(); 411 412 412 if (!(new_client = kmalloc(sizeof(struct i2c_client) + 413 sizeof(struct vt1211_data), 414 GFP_KERNEL))) { 413 if (!(data = kmalloc(sizeof(struct vt1211_data), GFP_KERNEL))) { 415 414 return -ENOMEM; 416 415 } 417 416 418 data = (struct vt1211_data *) (new_client + 1);417 new_client = &data->client; 419 418 new_client->addr = address; 420 419 init_MUTEX(&data->lock); … … 449 448 ERROR3: 450 449 release_region(address, VT1211_EXTENT); 451 kfree( new_client);450 kfree(data); 452 451 return err; 453 452 } … … 467 466 468 467 release_region(client->addr, VT1211_EXTENT); 469 kfree(client );468 kfree(client->data); 470 469 471 470 return 0; -
lm-sensors/trunk/kernel/chips/vt8231.c
r2319 r2445 135 135 136 136 struct vt8231_data { 137 struct i2c_client client; 137 138 struct semaphore lock; 138 139 int sysctl_id; … … 374 375 } 375 376 376 if (!(new_client = kmalloc(sizeof(struct i2c_client) + 377 sizeof(struct vt8231_data), 378 GFP_KERNEL))) { 377 if (!(data = kmalloc(sizeof(struct vt8231_data), GFP_KERNEL))) { 379 378 err = -ENOMEM; 380 379 goto ERROR0; 381 380 } 382 381 383 data = (struct vt8231_data *) (new_client + 1);382 new_client = &data->client; 384 383 new_client->addr = address; 385 384 init_MUTEX(&data->lock); … … 419 418 ERROR3: 420 419 release_region(address, VIA686A_EXTENT); 421 kfree( new_client);420 kfree(data); 422 421 ERROR0: 423 422 return err; … … 438 437 439 438 release_region(client->addr, VIA686A_EXTENT); 440 kfree(client );439 kfree(client->data); 441 440 442 441 return 0; -
lm-sensors/trunk/kernel/chips/w83627hf.c
r2302 r2445 278 278 dynamically allocated, at the same time when a new client is allocated. */ 279 279 struct w83627hf_data { 280 struct i2c_client client; 280 281 struct semaphore lock; 281 282 int sysctl_id; … … 661 662 But it allows us to access w83627hf_{read,write}_value. */ 662 663 663 if (!(new_client = kmalloc(sizeof(struct i2c_client) + 664 sizeof(struct w83627hf_data), 665 GFP_KERNEL))) { 664 if (!(data = kmalloc(sizeof(struct w83627hf_data), GFP_KERNEL))) { 666 665 err = -ENOMEM; 667 666 goto ERROR0; 668 667 } 669 668 670 data = (struct w83627hf_data *) (new_client + 1);669 new_client = &data->client; 671 670 new_client->addr = address; 672 671 init_MUTEX(&data->lock); … … 734 733 release_region(address, WINB_EXTENT); 735 734 ERROR1: 736 kfree( new_client);735 kfree(data); 737 736 ERROR0: 738 737 return err; … … 753 752 754 753 release_region(client->addr, WINB_EXTENT); 755 kfree(client );754 kfree(client->data); 756 755 757 756 return 0; -
lm-sensors/trunk/kernel/chips/w83l785ts.c
r2334 r2445 102 102 103 103 struct w83l785ts_data { 104 struct i2c_client client; 104 105 int sysctl_id; 105 106 … … 167 168 } 168 169 169 if (!(new_client = kmalloc(sizeof(struct i2c_client) + sizeof(struct w83l785ts_data), 170 GFP_KERNEL))) { 170 if (!(data = kmalloc(sizeof(struct w83l785ts_data), GFP_KERNEL))) { 171 171 printk(KERN_ERR "w83l785ts.o: Out of memory in w83l785ts_detect " 172 172 "(new_client).\n"); … … 175 175 176 176 /* 177 * The W83L785TS-specific data is placed right after the common I2C 178 * client data, and is pointed to by the data field from the I2C 179 * client data. 180 */ 181 177 * The common I2C client data is placed right after the 178 * W83L785TS-specific. The W83L785TS-specific data is pointed to by the 179 * data field from the I2C client data. 180 */ 181 182 new_client = &data->client; 182 183 new_client->addr = address; 183 new_client->data = data = (struct w83l785ts_data *) (new_client + 1);184 new_client->data = data; 184 185 new_client->adapter = adapter; 185 186 new_client->driver = &w83l785ts_driver; … … 280 281 i2c_detach_client(new_client); 281 282 ERROR1: 282 kfree( new_client);283 kfree(data); 283 284 return err; 284 285 } … … 295 296 } 296 297 297 kfree(client );298 kfree(client->data); 298 299 return 0; 299 300 } -
lm-sensors/trunk/kernel/chips/xeontemp.c
r2336 r2445 79 79 /* Each client has this additional data */ 80 80 struct xeontemp_data { 81 struct i2c_client client; 81 82 int sysctl_id; 82 83 enum chips type; … … 168 169 But it allows us to access xeontemp_{read,write}_value. */ 169 170 170 if (!(new_client = kmalloc(sizeof(struct i2c_client) + 171 sizeof(struct xeontemp_data), 172 GFP_KERNEL))) { 171 if (!(data = kmalloc(sizeof(struct xeontemp_data), GFP_KERNEL))) { 173 172 err = -ENOMEM; 174 173 goto error0; 175 174 } 176 175 177 data = (struct xeontemp_data *) (new_client + 1);176 new_client = &data->client; 178 177 new_client->addr = address; 179 178 new_client->data = data; … … 227 226 error3: 228 227 error1: 229 kfree( new_client);228 kfree(data); 230 229 error0: 231 230 return err; … … 254 253 } 255 254 256 kfree(client );255 kfree(client->data); 257 256 258 257 return 0;
