ALSA: aoa/onyx: Fix OF node leak on probe failure
Subsystems (2)
PATCH 1/2 ALSA: aoa/onyx: Fix OF node leak on probe failure
From: wangdicheng <[email protected]>
Add missing of_node_put() in the error path.
Signed-off-by wangdicheng <[email protected]>
--- sound/aoa/codecs/onyx.c | 1 + 1 file changed, 1 insertion(+)
sound/aoa/codecs/onyx.c +1 -0
@@ -985,6 +985,7 @@ static int onyx_i2c_probe(struct i2c_client *client) printk(KERN_DEBUG PFX "created and attached onyx instance\n");return 0 ; fail: +of_node_put (onyx->codec.node);kfree (onyx);return -ENODEV ; }
Signature · 1 line
2.25.1
Quoted 15 lines · On Thu, 02 Apr 2026 04:35:41 +0200, [email protected] wrote:
From: wangdicheng <[email protected]>
Add missing
of_node_put()in the error path.Signed-off-by wangdicheng <[email protected]>--- sound/aoa/codecs/onyx.c | 1 + 1 file changed, 1 insertion(+)sound/aoa/codecs/onyx.c +0
-0
sound/aoa/codecs/onyx.c static int onyx_i2c_probe(struct i2c_client *client) · line 990
Quoted 6 lines
sound/aoa/codecs/onyx.c +1
-0@@ -985,6 +985,7 @@ static int onyx_i2c_probe(struct i2c_client *client) printk(KERN_DEBUG PFX "created and attached onyx instance\n");return 0 ; fail: +of_node_put (onyx->codec.node);kfree (onyx);return -ENODEV ;
This error path is used commonly for the code path before of_node_get(), hence you can't put of_node_put() unconditionally.
You'll need another goto label for of_node_put() and the error path from aoa_codec_register() should jump to it.
thanks,
Takashi