This pull request contains the following fix for UBI:

- Don't try to attach MTDs with erase block size 0
 -----BEGIN PGP SIGNATURE-----
 
 iQJKBAABCAA0FiEEdgfidid8lnn52cLTZvlZhesYu8EFAmUanmwWHHJpY2hhcmRA
 c2lnbWEtc3Rhci5hdAAKCRBm+VmF6xi7wb/aD/0RKZx4aZbXyAM6ezVB189pMxkC
 LHEtAwJx2l1IYgfNrLK3G/Rpr44/1i63oyhfGJv+QQ4SgYHlSnWp/6vTpshVSw4h
 37XzlNDAb6XomtvosFbLUgKQFJWifv4ZEnmdBay8RiM2cugzwGor/5IX52x4LuVg
 0ilgCMHt+F/mglXQ6ONv2Cl8nkM343qXzYGM08Z6tH++VNgr/c78PQUJAp21u3f3
 1bQDfjw5IQqriDKcx1BFO7uDVbMrxl66sUYJZb8mOar992gUUES9yRdsNMnFyuey
 cY8XBalNXrVL7YVJEJft3KU3q3/aPCQk8+bji3G4PvWDhpGlkk/plYSPxk8NkNEH
 FLoBrdJSe1gCSnl9268GldCadhIeUXjVcT6OoHU9c+v3xdYIQ4ew+CDEyV80iTxr
 nR87mkJR4snxpMlXqX7o0gFp/LhT1Rouu4glawtmctyfl+w2cFmUOGWlVo5hUfOh
 Ny1IAlwlWGECSGMP5VyQODasdYBbLremejfybx1FKH6DGvDIGcdOCGD5DBMM4Foy
 QWP7QqjCHcdmjiEfaZvWL94I7EJEP9YNdb1lx7mOMRaB2tLVlmw3pu8OOG5A6WkF
 6CkL5AsHkB6+bQO7MX1ZyIeQUMx+r1xUIywHnRKe5VSytF1YWu6pfbrrnILvDiaR
 rDMhb9RCOvVAfPFWYQ==
 =Fey2
 -----END PGP SIGNATURE-----

Merge tag 'ubifs-for-linus-6.6-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs

Pull UBI fix from Richard Weinberger:

 - Don't try to attach MTDs with erase block size 0

* tag 'ubifs-for-linus-6.6-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs:
  ubi: Refuse attaching if mtd's erasesize is 0
This commit is contained in:
Linus Torvalds 2023-10-02 14:10:46 -07:00
commit ce36c8b149

View File

@ -894,6 +894,13 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num,
return -EINVAL;
}
/* UBI cannot work on flashes with zero erasesize. */
if (!mtd->erasesize) {
pr_err("ubi: refuse attaching mtd%d - zero erasesize flash is not supported\n",
mtd->index);
return -EINVAL;
}
if (ubi_num == UBI_DEV_NUM_AUTO) {
/* Search for an empty slot in the @ubi_devices array */
for (ubi_num = 0; ubi_num < UBI_MAX_DEVICES; ubi_num++)