This pull request contains the following fix for UBI:

- Don't try to attach MTDs with erase block size 0
ubi: Refuse attaching if mtd's erasesize is 0

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: 801c135ce73d ("UBI: Unsorted Block Images")
Reported-by: Yu Hao <>
Signed-off-by: Zhihao Cheng <>
Reviewed-by: Miquel Raynal <>
Signed-off-by: Richard Weinberger <>
1 file changed