]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ALSA: aoa/onyx: Fix OF node leak on probe failure
authorwangdicheng <wangdicheng@kylinos.cn>
Fri, 3 Apr 2026 01:47:36 +0000 (09:47 +0800)
committerTakashi Iwai <tiwai@suse.de>
Fri, 3 Apr 2026 08:10:23 +0000 (10:10 +0200)
Add missing of_node_put() in the error path.

Signed-off-by: wangdicheng <wangdicheng@kylinos.cn>
Link: https://patch.msgid.link/20260403014736.33014-1-wangdich9700@163.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/aoa/codecs/onyx.c

index 04961c456d2c5057d39261de2d555121d47ee417..da0eebf5dfbc2db85e85ef2c881d19d52ff5178b 100644 (file)
@@ -980,10 +980,12 @@ static int onyx_i2c_probe(struct i2c_client *client)
        onyx->codec.node = of_node_get(node);
 
        if (aoa_codec_register(&onyx->codec)) {
-               goto fail;
+               goto fail_put;
        }
        printk(KERN_DEBUG PFX "created and attached onyx instance\n");
        return 0;
+ fail_put:
+       of_node_put(onyx->codec.node);
  fail:
        kfree(onyx);
        return -ENODEV;