[PATCH 6.6 169/273] ubi: Add a check for ubi_num