Here's possible solution to your problem.
If your camera is not working on Samsung Galaxy and displays the message as “WARNING : CAMERA FAILED” then try the possible solution to fix the camera problem.
Try to reset the device to Factory settings.
Format your Memory card. Note: backup important files.
Update your Samsung Galaxy to new firmware because your old firmware what you have currently on your phone can have bugs.If the update is not available then erase your phone fully and flash the phone.
Disable the Location option in your Samsung Galaxy.