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

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: 7636f090d02e ("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>

authored by

Johan Hovold and committed by
Ilpo Järvinen
bc48d79a c86f7bb9

+2
+2
drivers/platform/arm64/huawei-gaokun-ec.c
··· 662 662 { 663 663 struct auxiliary_device *adev = to_auxiliary_dev(dev); 664 664 665 + of_node_put(dev->of_node); 665 666 kfree(adev); 666 667 } 667 668 ··· 694 693 695 694 ret = auxiliary_device_init(adev); 696 695 if (ret) { 696 + of_node_put(adev->dev.of_node); 697 697 kfree(adev); 698 698 return ret; 699 699 }