diff options
author | 2011-05-18 18:08:05 +0300 | |
---|---|---|
committer | 2011-06-01 11:23:12 +0300 | |
commit | 01a4110d2b86b05918debf39c50867cbb9598491 (patch) | |
tree | f49a4af9c6834f88457cb4c2b27df745fda58bf6 /kernel/workqueue.c | |
parent | UBI: switch debugging tests knobs to debugfs (diff) | |
download | linux-rng-01a4110d2b86b05918debf39c50867cbb9598491.tar.xz linux-rng-01a4110d2b86b05918debf39c50867cbb9598491.zip |
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: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'kernel/workqueue.c')
0 files changed, 0 insertions, 0 deletions