Fruit flies need moisture to lay their eggs so your cereal is fine.

I had them for a brief period when I kept bananas on the counter, the bananas came home from Walmart with the fruit fly eggs already on the skin most likely and they'd hatch on my counter and probably infest my trash. The way I got rid of them was by putting a small amount of apple cider vinegar in a glass and then adding some dish soap. The dish soap is critical because it breaks the surface tension so that they cannot land to lay their eggs. Then to top it all off you put plastic wrap over the top and poke a few holes in it with a fork. The fruit flies will find their way in but are too dumb to get out after they've gone in. This is basically going to trap and drown all the flies if you place it where they are located. If you have no apple cider vinegar soy sauce works great too.

Fun fact, if you leave soy sauce out and it is one of those dispensers without a tight lid (like in the restaurants), poor it out into your sink. You will be disgusted by the hundreds of fruit flies that poor out with the soy sauce. You will most likely want to vomit, so be careful to have your head over the sink as you poor. This is why I do not use soy sauce at most restaurants.