Skip to content

Commit bc48d79

Browse files
jhovoldij-intel
authored andcommitted
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: 7636f09 ("platform: arm64: add Huawei Matebook E Go EC driver") Cc: Pengyu Luo <[email protected]> Signed-off-by: Johan Hovold <[email protected]> Reviewed-by: Pengyu Luo <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]>
1 parent c86f7bb commit bc48d79

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/platform/arm64/huawei-gaokun-ec.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,7 @@ static void gaokun_aux_release(struct device *dev)
662662
{
663663
struct auxiliary_device *adev = to_auxiliary_dev(dev);
664664

665+
of_node_put(dev->of_node);
665666
kfree(adev);
666667
}
667668

@@ -693,6 +694,7 @@ static int gaokun_aux_init(struct device *parent, const char *name,
693694

694695
ret = auxiliary_device_init(adev);
695696
if (ret) {
697+
of_node_put(adev->dev.of_node);
696698
kfree(adev);
697699
return ret;
698700
}

0 commit comments

Comments
 (0)