This is a very complex question with few facts with which to work,
Every situation is different and the outcomes vary with each situation.
YOU MUST CONSULT AN ATTORNEY OR FINANCIAL ADVISOR to determine the consequences for any action you may take.
If critical importance is knowing if you are:
1. Selling your home and bringing cash to the table to pay off the balance
2. Selling your home for a profit
3. Selling your home for less than the balance of the mortgage (short sale)
As you may be aware, if #3 is your situation, the amount that may be forgiven by the bank will be stated in a 1099 as unearned income. This amount will reflect the highest possible amount the bank can create by adding penalties, late fees, legal fees, admin fees, baggage fees, lunch fees, parking tickets, RNC donations, and if they can, they'll slip in a few bucks for the off-shore call center. Working with your attorney or financial adviser who will have intimate knowledge of your situation will most likely result in a favorable outcome.
From your question it can not be determined what your situation is. Seek guidance from a professional.