While most historians and readers of history look at the Iranian Revolution as a disaster of US foreign policy where by the US lost a vital chess piece in the global contest for supremacy which weakened US power in the Middle East and the hostage crisis that followed, there were still silver linings.
Firstly a theocratic Iran under the leadership of the Ayatollah with the immense popular support from the Iranian people did act as a strong buffer against the southward projection of Soviet power. Iran under the Shah technically served as a buffer against Soviet expansionism too, but it was not as effective as Iran after the Revolution due to the Shah's unpopularity, the refusal to aid the Afghan resistance movements and the growing power of the Marxist movement inside Iran. A strong Iran as a buffer was needed to prevent the Soviets from conquering the oil fields of the gulf and from gaining a warm water port.
Secondly the Iranian Revolution of 1979 finally paved the way for the destruction of the growing pro-Soviet movements inside Iran. The CIA did give a list of communist suspects to the theocrats of Iran to silence, though the US broke relations with Iran on that same year. Therefore, it completely eradicated Soviet influence inside Iran.
Finally the Iranian Revolution of 1979 accelerated the growth of the emerging arc of crisis that was unfolding in Central Asia which directly contributed to the collapse of the USSR. When the theocrats of Iran came they dramatically increased financial aid to the Afghan resistance movement as well as absorbing most of the Afghan refugees from the war. As a consequence the Afghan resistance movement became stronger than ever and the Soviets became bogged down in Afghanistan. With the war now favouring the freedom fighters of Afghanistan, economic stagnation in the USSR turned into economic decay due to the tremendous cost of financing the war and the health of Soviet war veterans who served in Afghanistan. Meanwhile the theocratic Iran which shared a border with Soviet Azerbaijan enabled the spread of Islamic fundamentalism into the Central Asian republics of the USSR. This, in a way helped the people of Central Asia who were ethnically divided to finally unite under a common cause, which was Islam and led them to reject Soviet domination of their lands. As a result the simultaneous processes of the Soviets being unable to project power into the heartlands of US influence which is Arabia, the Soviet forces being bogged down in Afghanistan which paved the path for Soviet economic decay, and the massive decline in Soviet control of Central Asia all led to the demise of the USSR and the birth of the world's first truly global power,which is the US.