Char/Misc fixes for 4.15-rc3

Here are some small misc driver fixes for 4.15-rc3 to resolve reported
 issues.  Specifically these are:
 	- binder fix for a memory leak
 	- vpd driver fixes for a number of reported problems
 	- hyperv driver fix for memory accesses where it shouldn't be.
 
 All of these have been in linux-next for a while.  There's also one more
 MAINTAINERS file update that came in today to get the Android
 developer's emails correct, which is also in this pull request, that was
 not in linux-next, but should not be an issue.
 
 Signed-off-by: Greg Kroah-Hartman <[email protected]>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCWia6IQ8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ykaKwCgx1lw4qMmetUzjKBX+OMgEkFZo3UAoIL/DLiB
 ZyMb52XWdP0pScSsFUyn
 =riSs
 -----END PGP SIGNATURE-----

Merge tag 'char-misc-4.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Pull char/misc fixes from Greg KH:
 "Here are some small misc driver fixes for 4.15-rc3 to resolve reported
  issues. Specifically these are:

   - binder fix for a memory leak

   - vpd driver fixes for a number of reported problems

   - hyperv driver fix for memory accesses where it shouldn't be.

  All of these have been in linux-next for a while. There's also one
  more MAINTAINERS file update that came in today to get the Android
  developer's emails correct, which is also in this pull request, that
  was not in linux-next, but should not be an issue"

* tag 'char-misc-4.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
  MAINTAINERS: update Android driver maintainers.
  firmware: vpd: Fix platform driver and device registration/unregistration
  firmware: vpd: Tie firmware kobject to device lifetime
  firmware: vpd: Destroy vpd sections in remove function
  hv: kvp: Avoid reading past allocated blocks from KVP file
  Drivers: hv: vmbus: Fix a rescind issue
  ANDROID: binder: fix transaction leak.
This commit is contained in:
Linus Torvalds 2017-12-05 10:06:23 -08:00
commit 6a5e05a47b
7 changed files with 95 additions and 84 deletions

View file

@ -295,38 +295,60 @@ static int vpd_probe(struct platform_device *pdev)
if (ret)
return ret;
return vpd_sections_init(entry.cbmem_addr);
vpd_kobj = kobject_create_and_add("vpd", firmware_kobj);
if (!vpd_kobj)
return -ENOMEM;
ret = vpd_sections_init(entry.cbmem_addr);
if (ret) {
kobject_put(vpd_kobj);
return ret;
}
return 0;
}
static int vpd_remove(struct platform_device *pdev)
{
vpd_section_destroy(&ro_vpd);
vpd_section_destroy(&rw_vpd);
kobject_put(vpd_kobj);
return 0;
}
static struct platform_driver vpd_driver = {
.probe = vpd_probe,
.remove = vpd_remove,
.driver = {
.name = "vpd",
},
};
static struct platform_device *vpd_pdev;
static int __init vpd_platform_init(void)
{
struct platform_device *pdev;
int ret;
pdev = platform_device_register_simple("vpd", -1, NULL, 0);
if (IS_ERR(pdev))
return PTR_ERR(pdev);
ret = platform_driver_register(&vpd_driver);
if (ret)
return ret;
vpd_kobj = kobject_create_and_add("vpd", firmware_kobj);
if (!vpd_kobj)
return -ENOMEM;
platform_driver_register(&vpd_driver);
vpd_pdev = platform_device_register_simple("vpd", -1, NULL, 0);
if (IS_ERR(vpd_pdev)) {
platform_driver_unregister(&vpd_driver);
return PTR_ERR(vpd_pdev);
}
return 0;
}
static void __exit vpd_platform_exit(void)
{
vpd_section_destroy(&ro_vpd);
vpd_section_destroy(&rw_vpd);
kobject_put(vpd_kobj);
platform_device_unregister(vpd_pdev);
platform_driver_unregister(&vpd_driver);
}
module_init(vpd_platform_init);