[PATCH v2] mtd: Make mtd_erase fail gracefully if CONFIG_MTD_WRITE is off
Sascha Hauer
s.hauer at pengutronix.de
Wed Sep 3 22:39:27 PDT 2025
On Wed, 03 Sep 2025 16:31:21 +0200, Christian Thießen via B4 Relay wrote:
> When CONFIG_MTD_WRITE is unset, the mtd->_erase member of partition
> devices does not get initialized, so it remains NULL.
> However when running ubiattach on an UBI partition, mtd_erase() still
> gets called, tries to call mtd->_erase and crashes. Make it fail
> gracefully by returning ENOSYS ("Function not implemented") instead.
>
>
> [...]
Applied, thanks!
[1/1] mtd: Make mtd_erase fail gracefully if CONFIG_MTD_WRITE is off
https://git.pengutronix.de/cgit/barebox/commit/?id=b530b3d7ebf8 (link may not be stable)
Best regards,
--
Sascha Hauer <s.hauer at pengutronix.de>
More information about the barebox
mailing list