But you also may have potential gain/loss on the sale of your stock.
The current year income/loss and separately stated items adjust your basis (as well as any prior year items did; it's best to compute basis at the end of every year taking into account that years income/loss, separately stated items, and distributions/contributions) .
You have to compare the amount of distributions you received in exchange (or surrendering ) for your stock. If the total distributions exceeded your adjusted basis in stock, then you have a gain; if less, than a loss (capital gain/loss and depending on your holding period long or short term).
Here is a link for information regarding S Corporations and it includes other links as well.
https://www.irs.gov/businesses/small-businesses-self-employed/s-corporations
**Disclaimer: Effort has been made to offer correct information; but due to the discussion forum limitations, the poster disclaims any legal responsibility for the accuracy of the poster's response**