mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-18 17:54:13 +08:00
0bf1c4399a
In the error path of 'ubi_attach_mtd_dev()' we have a tricky situation: we have to release things differently depending on at which point the failure happening. Namely, if @ubi->dev is not initialized, we have to free everything ourselves. But if it was, we should not free the @ubi object, because it will be freed in the 'dev_release()' function. And we did not get this situation right. This patch introduces additional argument to the 'uif_init()' function. On exit, this argument indicates whether the final 'free(ubi)' will happen in 'dev_release()' or not. So the caller always knows how to properly release the resources. Impact: all memory is now correctly released when UBI fails to attach an MTD device. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> |
||
---|---|---|
.. | ||
build.c | ||
cdev.c | ||
debug.c | ||
debug.h | ||
eba.c | ||
gluebi.c | ||
io.c | ||
kapi.c | ||
Kconfig | ||
Kconfig.debug | ||
Makefile | ||
misc.c | ||
scan.c | ||
scan.h | ||
ubi-media.h | ||
ubi.h | ||
upd.c | ||
vmt.c | ||
vtbl.c | ||
wl.c |