aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/hack-4.14
diff options
context:
space:
mode:
authorMathias Kresin <dev@kresin.me>2018-07-08 01:38:08 +0200
committerJo-Philipp Wich <jo@mein.io>2018-12-18 09:50:47 +0100
commitedc2af2be931c43a1ee111800737b08bacc60126 (patch)
treea1b7fa94aa9872a954a87b4a2140d63211e22218 /target/linux/generic/hack-4.14
parentc0673db23f1c98ccb9e5f71ec21b94153684fc80 (diff)
downloadupstream-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/hack-4.14')
0 files changed, 0 insertions, 0 deletions