Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'hwmon-for-linus' of git://github.com/groeck/linux

* 'hwmon-for-linus' of git://github.com/groeck/linux:
hwmon: (coretemp) Avoid leaving around dangling pointer
hwmon: (coretemp) Fixup platform device ID change

+13 -15
+13 -15
drivers/hwmon/coretemp.c
··· 377 377 } 378 378 379 379 380 - static int __devinit chk_ucode_version(struct platform_device *pdev) 380 + static int __cpuinit chk_ucode_version(unsigned int cpu) 381 381 { 382 - struct cpuinfo_x86 *c = &cpu_data(pdev->id); 382 + struct cpuinfo_x86 *c = &cpu_data(cpu); 383 383 int err; 384 384 u32 edx; 385 385 ··· 390 390 */ 391 391 if (c->x86_model == 0xe && c->x86_mask < 0xc) { 392 392 /* check for microcode update */ 393 - err = smp_call_function_single(pdev->id, get_ucode_rev_on_cpu, 393 + err = smp_call_function_single(cpu, get_ucode_rev_on_cpu, 394 394 &edx, 1); 395 395 if (err) { 396 - dev_err(&pdev->dev, 397 - "Cannot determine microcode revision of " 398 - "CPU#%u (%d)!\n", pdev->id, err); 396 + pr_err("Cannot determine microcode revision of " 397 + "CPU#%u (%d)!\n", cpu, err); 399 398 return -ENODEV; 400 399 } else if (edx < 0x39) { 401 - dev_err(&pdev->dev, 402 - "Errata AE18 not fixed, update BIOS or " 403 - "microcode of the CPU!\n"); 400 + pr_err("Errata AE18 not fixed, update BIOS or " 401 + "microcode of the CPU!\n"); 404 402 return -ENODEV; 405 403 } 406 404 } ··· 506 508 507 509 return 0; 508 510 exit_free: 511 + pdata->core_data[attr_no] = NULL; 509 512 kfree(tdata); 510 513 return err; 511 514 } ··· 542 543 { 543 544 struct platform_data *pdata; 544 545 int err; 545 - 546 - /* Check the microcode version of the CPU */ 547 - err = chk_ucode_version(pdev); 548 - if (err) 549 - return err; 550 546 551 547 /* Initialize the per-package data structures */ 552 548 pdata = kzalloc(sizeof(struct platform_data), GFP_KERNEL); ··· 624 630 } 625 631 626 632 pdev_entry->pdev = pdev; 627 - pdev_entry->phys_proc_id = TO_PHYS_ID(cpu); 633 + pdev_entry->phys_proc_id = pdev->id; 628 634 629 635 list_add_tail(&pdev_entry->list, &pdev_list); 630 636 mutex_unlock(&pdev_list_mutex); ··· 685 691 return; 686 692 687 693 if (!pdev) { 694 + /* Check the microcode version of the CPU */ 695 + if (chk_ucode_version(cpu)) 696 + return; 697 + 688 698 /* 689 699 * Alright, we have DTS support. 690 700 * We are bringing the _first_ core in this pkg