HSI changes for the 5.13 series

* memory leak fix in hsi_add_client_from_dt() error path
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAmCHI4wACgkQ2O7X88g7
 +pq7JA//Xd0yDa9ro6im0Hlu1ND13nRuHjVoMD9K05wzpdKI/ARHd6qkWxfWqmMl
 E2aMKK3Qm6yAuE2oiiuIC78j7ejE1MB6SWa+GTqhHO7/RxGdbCb/xtdVmIh3DMC1
 l1CBdoMRibfu80K+/FrIvnAN76WFiyY5P6nPGNcmac+DXWanvKRLVPuSXpcFz88h
 82jROpRcoZ9nPR1ubdY5HTfrPhVr/8E9K6UJ+dnXRz4WNACO85ue5kBFWPz9JS4k
 BltaW6L7PteaiMO7fbL/hMJRc4ItmfmyIam+XSsq7IhmaZfNFEl+/u4RSKqUbfjr
 tXWnGkRXFWzoJN90OX51VLonbJrYacaXJEzD/VQ9CRDKeLLVsS24upZH/5i9dJ2U
 Hh3InjS5zNHWqdDpJqzeu/31WwsQQ2QNfYviueYhWScS/GjbFRAUNgxBhfCZdbsB
 aKix/GYbxqep2ntcz/+YUFxus7Hv201XO3PnZuV80RQL9MOxTpDPde2j/xvvVO7j
 HyDBdw0mSDstyi1Xg80cLEdNz4v8h1AcWRPY3sKLmPE86/KBySOyQbKonJmreqiE
 JamwkFtBJKlH1QseIR3jo7Rj9bXb6CW0HGyfkvQ4qmfHD3rKj3Yu3OhE8aUgmzJ1
 95GwkCkYKwx36V8npddGOxOa9daL5tAzl+GouhfgQiReCcE3iE0=
 =HIRp
 -----END PGP SIGNATURE-----

Merge tag 'hsi-for-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-hsi

Pull HSI update from Sebastian Reichel:

 - memory leak fix in hsi_add_client_from_dt() error path

* tag 'hsi-for-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-hsi:
  HSI: core: fix resource leaks in hsi_add_client_from_dt()
This commit is contained in:
Linus Torvalds 2021-04-28 15:39:38 -07:00
commit a8b5e037d8
1 changed files with 1 additions and 2 deletions

View File

@ -210,8 +210,6 @@ static void hsi_add_client_from_dt(struct hsi_port *port,
if (err) if (err)
goto err; goto err;
dev_set_name(&cl->device, "%s", name);
err = hsi_of_property_parse_mode(client, "hsi-mode", &mode); err = hsi_of_property_parse_mode(client, "hsi-mode", &mode);
if (err) { if (err) {
err = hsi_of_property_parse_mode(client, "hsi-rx-mode", err = hsi_of_property_parse_mode(client, "hsi-rx-mode",
@ -293,6 +291,7 @@ static void hsi_add_client_from_dt(struct hsi_port *port,
cl->device.release = hsi_client_release; cl->device.release = hsi_client_release;
cl->device.of_node = client; cl->device.of_node = client;
dev_set_name(&cl->device, "%s", name);
if (device_register(&cl->device) < 0) { if (device_register(&cl->device) < 0) {
pr_err("hsi: failed to register client: %s\n", name); pr_err("hsi: failed to register client: %s\n", name);
put_device(&cl->device); put_device(&cl->device);