. . . a "warning" is not an error. The warning is saying that if you return a value explicitly in any part of the function, you must then make sure to return a value explicitly for every possible execution of the code. This usually requires returning at the end of the function but it can also be an indication of a bad formulation for the function.
Also, I just noticed that you are returning inside the loop so it will stop the function after the first execution of the loop.
Ahh that was it! Moving the return fixed the warning. (edited above) Good catch.