Commit 8b1b5ba4 authored by Li Nan's avatar Li Nan
Browse files

ubi: block: fix memleak in ubiblock_create()

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



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

If idr_alloc() fails, dev->gd will be put after goto out_cleanup_disk in
ubiblock_create(), but dev->gd has not been assigned yet at this time, and
gd will not be put anymore. Fix it by putting gd directly.

Signed-off-by: default avatarLi Nan <linan122@huawei.com>
parent ffaa81fb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment