generic: fitblk: close block device if mapping image failed
authorDaniel Golle <[email protected]>
Fri, 28 Mar 2025 15:40:28 +0000 (15:40 +0000)
committerDaniel Golle <[email protected]>
Fri, 28 Mar 2025 15:42:41 +0000 (15:42 +0000)
commit2b9c81d1cbc65eeb9304b7274058418efa8a9c78
tree7683789dcc06c572d0ecc114993f87f4bbc40da1
parent21cece29e9eebc397eadee259e60c7fc44828cce
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 <[email protected]>
target/linux/generic/pending-6.6/510-block-add-uImage.FIT-subimage-block-driver.patch