Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 01a4110d authored by Artem Bityutskiy's avatar Artem Bityutskiy
Browse files

UBI: fix oops in error path



This patch fixes an oops in the error path of 'ubi_attach_mtd_dev()'. If
anything after 'uif_init()' fails, we get an oops in 'cancel_pending()'. The
reason is that 'uif_close()' drops the last reference count for 'ubi->dev' and
whole 'struct ubi_device' is freed. And then
'ubi_wl_close()'->'cancel_pending()' tries to access the 'ubi' pointer and
problems begin.

Note, in 'ubi_detach_mtd_dev()' function we get a device reference to
work-around this issue. Do the same in the error path of
'ubi_attach_mtd_dev()'.

Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
parent cd6d8567
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment