Joseph Smith and Brigham Young taught many outlandish things that they got persecuted for, and if racism was not part of the restored gospel, they should have taught that as well. If racism was truly part of the restored gospel, then we can consider them true prophets of God. Otherwise, they taught their own personal racist beliefs regardless of any restored gospel, or they weren't prophets of God.