]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
LoongArch: Fix missing NULL checks for kstrdup()
authorLi Jun <lijun01@kylinos.cn>
Thu, 26 Mar 2026 06:29:08 +0000 (14:29 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Thu, 26 Mar 2026 06:29:08 +0000 (14:29 +0800)
commit3a28daa9b7d7c2ddf2c722e9e95d7e0928bf0cd1
treeeb98863dc5e80b5e1df1c4a64712dd4c410ca9c2
parentc369299895a591d96745d6492d4888259b004a9e
LoongArch: Fix missing NULL checks for kstrdup()

1. Replace "of_find_node_by_path("/")" with "of_root" to avoid multiple
calls to "of_node_put()".

2. Fix a potential kernel oops during early boot when memory allocation
fails while parsing CPU model from device tree.

Cc: stable@vger.kernel.org
Signed-off-by: Li Jun <lijun01@kylinos.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
arch/loongarch/kernel/env.c