]> git.ipfire.org Git - thirdparty/openwrt.git/commit
generic: fitblk: close block device if mapping image failed
authorDaniel Golle <daniel@makrotopia.org>
Fri, 28 Mar 2025 15:40:28 +0000 (15:40 +0000)
committerDaniel Golle <daniel@makrotopia.org>
Mon, 14 Apr 2025 17:32:05 +0000 (18:32 +0100)
commit9e9f6875bcc576946f37dce8d88742d259065f0b
tree8c403e9d966a2e3f1e75c60e7bffe6781224c5ab
parentbe1b2548882fc04237e67882dc84449678019f7f
generic: fitblk: close block device if mapping image failed

In case a broken fit image is present on flash the fitblk driver would
not map any /dev/fit* devices, but also not always close the block device
the image resides on. In case of ubiblock devices this is fatal as one
then cannot remove the ubiblock device (-EBUSY), and hence cannot replace
the broken image.
Always close the block device in case no sub-image was mapped.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 2b9c81d1cbc65eeb9304b7274058418efa8a9c78)
target/linux/generic/pending-6.6/510-block-add-uImage.FIT-subimage-block-driver.patch