I've fixed some of my guitars by turning it back and forth, if it works, it means that it was just some dust.
If it keeps on doing it, you might want to see it checked by a guy who knows some electronics, because the "path" the pot takes might have a blind spot, which needs soldering