aboutsummaryrefslogtreecommitdiff
path: root/scripts/gdb/linux
diff options
context:
space:
mode:
authorSebastian Siewior <[email protected]>2015-11-26 21:23:48 +0100
committerRichard Weinberger <[email protected]>2015-12-16 22:52:46 +0100
commit1a31b20cd81d5cbc7ec6e24cb08066009a1ca32d (patch)
treecc247bb7803e3576995306bf143c76a95b34c040 /scripts/gdb/linux
parent2e69d4912f2fc9d4cd952311d58ceae1cd83057b (diff)
mtd: ubi: fixup error correction in do_sync_erase()
Since fastmap we gained do_sync_erase(). This function can return an error and its error handling isn't obvious. First the memory allocation for struct ubi_work can fail and as such struct ubi_wl_entry is leaked. However if the memory allocation succeeds then the tail function takes care of the struct ubi_wl_entry. A free here could result in a double free. To make the error handling simpler, I split the tail function into one piece which does the work and another which frees the struct ubi_work which is passed as argument. As result do_sync_erase() can keep the struct on stack and we get rid of one error source. Cc: <[email protected]> Fixes: 8199b901a ("UBI: Add fastmap support to the WL sub-system") Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
Diffstat (limited to 'scripts/gdb/linux')
0 files changed, 0 insertions, 0 deletions