diff options
author | Mathias Kresin <dev@kresin.me> | 2018-07-08 01:38:08 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2018-12-18 09:50:47 +0100 |
commit | edc2af2be931c43a1ee111800737b08bacc60126 (patch) | |
tree | a1b7fa94aa9872a954a87b4a2140d63211e22218 /target/linux/generic/backport-4.14 | |
parent | c0673db23f1c98ccb9e5f71ec21b94153684fc80 (diff) | |
download | upstream-edc2af2be931c43a1ee111800737b08bacc60126.tar.gz upstream-edc2af2be931c43a1ee111800737b08bacc60126.tar.bz2 upstream-edc2af2be931c43a1ee111800737b08bacc60126.zip |
kernel: improve ubi auto attach code readability
Move the put_mtd_device() called on multiple error conditions to a goto
label to use it later for more error conditions.
The early return on failed open of the mtd device and mismatching mtd
type allows to get rid of one level of indentation. By jumping to the
cleanup code, a refcount bug is fixed for the wrong flash type condition.
While at it, make clear that we only check for the UBI magic if the read
from flash was successful.
Signed-off-by: Mathias Kresin <dev@kresin.me>
(backported from fdf6760cda15b2710287c66c9969a3ed527793d8)
(rebased patches)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'target/linux/generic/backport-4.14')
0 files changed, 0 insertions, 0 deletions