Can you sand the flakes off and then paint your wall again? You may need to go back and fill in some spots with spackle though.
Why did it flake? Is it really old?
If someone painted latex paint on top of oil based paint, without proper cleaning and priming, then the latex paint will flake off of the enamel paint.
So, just sanding the flakes off, and filling in the gaps with spackling compound, may not be all there is to it.
In all cases, I would buy a very good high-quality primer, that would be labeled as a binding primer.
Is the flakey paint in bathroom, kitchen or laundry room where there is more humidity?
Why is the paint flaking?
I agree with Jessica. Get to the root of the problem or any new paint will flake too.