Running a complete wash cycle without any laundry or wiping the inside of the washer drum with a cleaning solution are ways to clean a smelly washing machine. This routine maintenance performed every few months help rid washers of excess moisture and mildew which contribute to odors.
Select the largest load size, fill with hot water, and pour in either 1/4 to 1/2 baking soda or two to three cups of white distilled vinegar, depending on the size of the washer. Use a sponge and a mixture of bleach and hot water to attack stubborn soap scum. Run the washer on another cycle of just plain hot water to rinse the interior before loading clothes for a regular wash cycle.