mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
mtd: mtd_blkdevs: fix double free on error path
This one liner patch fixes double free that will occur if add_mtd_blktrans_dev fails. On failure it frees the input argument, but all its users also free it on error which is natural thing to do. Thus don't free it. All credit for finding that bug belongs to reporters of the bug in the android bugzilla http://code.google.com/p/android/issues/detail?id=13761 Commit message tweaked by Artem. Signed-off-by: Maxim Levitsky <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: David Woodhouse <[email protected]> Cc: [email protected]
This commit is contained in:
parent
82013d988f
commit
bd637f6f22
1 changed files with 0 additions and 1 deletions
|
|
@ -413,7 +413,6 @@ error3:
|
|||
error2:
|
||||
list_del(&new->list);
|
||||
error1:
|
||||
kfree(new);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue