I had this, waking up in the morning and finding that I could not straighten my finhger. I could bend it back with my other hand but it would 'click' back to the bent position if I tried to bend it. I had it for months.
If this is what you have got, then try this, I worked out this cure and have never been troubled since. Use sticking plaster to bind your bad finger to the one next to it before you go to bed. When you take the plaste roff in the morning your finger will not have locked itself and you will be able to use it perfectly well. I did this for about a month and it cured it completely. No drugs, no surgury.