Commit a18856a3 authored by Zhong Jinghua's avatar Zhong Jinghua Committed by Li Nan
Browse files

mtd/ubi/block: Fix null pointer dereference issue in error path

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I81XCK



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

When idr_alloc fails and goes the out_cleanup_disk error path, we get a
null pointer dereference problem because dev->gd has not been assigned
a value at this time.

Fix this problem by changing dev->gd to gd.

Fixes: 2bf50d42 ("UBI: block: Dynamically allocate minor numbers")
Signed-off-by: default avatarZhong Jinghua <zhongjinghua@huawei.com>
Signed-off-by: default avatarLi Nan <linan122@huawei.com>
parent 0e526263
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment