It is not permissible to
perform Salah in any Masjid that has a grave. This is because the Messenger of Allah (peace be upon him) forbade it and cursed those who take the graves as places of `Ibadah (worship).
It is not permissible to take a Masjid, in which there is a grave, as a place to serve food and give Sadaqah (voluntary charity). This is an act of Bid`ah (innovation in religion) and a means to seek the blessings of the grave's dweller. Giving Sadaqah with the purpose of drawing close to the grave's dweller is an act of Al-Shirk-ul-Akbar (major form of associating others in worship with Allah).May Allah grant us success. May peace and blessings be upon our Prophet Muhammad, his family, and Companions.