On associated and attached prime ideals of certain modules