mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
platform: arm64: huawei-gaokun-ec: fix OF node leak
Make sure to drop the OF node reference taken when creating the Gaokun
auxiliary devices when the devices are later released.
Fixes: 7636f090d0
("platform: arm64: add Huawei Matebook E Go EC driver")
Cc: Pengyu Luo <mitltlatltl@gmail.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Pengyu Luo <mitltlatltl@gmail.com>
Link: https://lore.kernel.org/r/20250708085358.15657-1-johan@kernel.org
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
This commit is contained in:
parent
c86f7bb92f
commit
bc48d79a18
1 changed files with 2 additions and 0 deletions
|
@ -662,6 +662,7 @@ static void gaokun_aux_release(struct device *dev)
|
|||
{
|
||||
struct auxiliary_device *adev = to_auxiliary_dev(dev);
|
||||
|
||||
of_node_put(dev->of_node);
|
||||
kfree(adev);
|
||||
}
|
||||
|
||||
|
@ -693,6 +694,7 @@ static int gaokun_aux_init(struct device *parent, const char *name,
|
|||
|
||||
ret = auxiliary_device_init(adev);
|
||||
if (ret) {
|
||||
of_node_put(adev->dev.of_node);
|
||||
kfree(adev);
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue