[PATCH 1/1] staging: fix a potential infinite loop