When the prohibition of wine was revealed, the people asked, "Messenger of Allah, what about our brothers who died while they were still drinking it?"Then this verse was revealed, "There is no blame on those who believe and do righteous deeds for what they have consumed" [Maidah 5:93], to the end of the verse.
حدثنا وكيع حدثنا إسرائيل عن سماك عن عكرمة
لما نزل تحريم الخمر قالوا يا رسول الله كيف بإخواننا الذين ماتوا وهم يشربونها فنزلت {ليس على الذين آمنوا وعملوا الصالحات جناح فيما طعموا} إلى آخر الآية