mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-30 00:56:45 +07:00
UBI: fix dereference after kfree
Coverity (CID 1614) spotted new_seb being dereferenced after kfree() in create_vtbl's write_error path. Signed-off-by: Florin Malita <fmalita@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
This commit is contained in:
parent
341e1a0cf2
commit
c4e90ec013
@ -317,14 +317,13 @@ static int create_vtbl(const struct ubi_device *ubi, struct ubi_scan_info *si,
|
||||
return err;
|
||||
|
||||
write_error:
|
||||
kfree(new_seb);
|
||||
/* May be this physical eraseblock went bad, try to pick another one */
|
||||
if (++tries <= 5) {
|
||||
/* Maybe this physical eraseblock went bad, try to pick another one */
|
||||
if (++tries <= 5)
|
||||
err = ubi_scan_add_to_list(si, new_seb->pnum, new_seb->ec,
|
||||
&si->corr);
|
||||
if (!err)
|
||||
goto retry;
|
||||
}
|
||||
kfree(new_seb);
|
||||
if (!err)
|
||||
goto retry;
|
||||
out_free:
|
||||
ubi_free_vid_hdr(ubi, vid_hdr);
|
||||
return err;
|
||||
|
Loading…
Reference in New Issue
Block a user