Commit 0c2a1d1c authored by Baokun Li's avatar Baokun Li Committed by Zheng Zengkai
Browse files

jffs2: fix NULL pointer dereference in jffs2_scan_medium

hulk inclusion
category: bugfix
bugzilla: 185988, https://gitee.com/openeuler/kernel/issues/I4YVV3



--------------------------------

In jffs2_scan_medium,
if `s = kzalloc(sizeof(struct jffs2_summary), GFP_KERNEL);` returns error,
go to "out" to do clear. Null pointer dereference occurs when
`if (s->sum_list_head)` is executed in "out".

Fixes: bf7ba557361f ("[Huawei] jffs2: fix memory leak in jffs2_scan_medium")
Signed-off-by: default avatarBaokun Li <libaokun1@huawei.com>
Reviewed-by: default avatarZhang Yi <yi.zhang@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 2363a57f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment