[mamory/f41] Fix -Werror=incompatible-pointer-types , cast return type properly