[PATCH OLK-5.10 2/2] ubi: Add a check for ubi_num