[PATCH 6.13 293/443] ubi: Add a check for ubi_num