mirror of
https://github.com/torvalds/linux.git
synced 2026-11-29 10:07:52 +00:00
There exists mtd devices with zero erasesize, which will trigger a
divide-by-zero exception while attaching ubi device.
Fix it by refusing attaching if mtd's erasesize is 0.
Fixes: 801c135ce7 ("UBI: Unsorted Block Images")
Reported-by: Yu Hao <[email protected]>
Link: https://lore.kernel.org/lkml/[email protected]/T/
Signed-off-by: Zhihao Cheng <[email protected]>
Reviewed-by: Miquel Raynal <[email protected]>
Signed-off-by: Richard Weinberger <[email protected]>