Dear sir,
Thank you for your posting your query at DoctorSpring.com
You have sebaceous cyst on the frenulum. Sebaceous cyst is formed when opening of the sweat glands gets closed. The white cheesy, dough-like material is sebum. The cyst keeps on growing with time as sebum keeps on getting collected.
Occasionally the cyst gets opened and the cheesy material comes out as it was in your case. The cyst once it gets opened it can become infected( you were lucky not to get infection).
The ideal treatment for such cyst is observation with little fiddling or excision by surgery. Call is yours.
Take care
Sincerely
Rajiv goel