1014.2 Egress through intervening spaces. Egress through intervening spaces shall comply with this section.
1. Egress from a room or space shall not pass through adjoining or intervening rooms or areas, except where such adjoining rooms or areas and the area served are accessory to one or the other, are not a Group H occupancy and provide a discernible path of egress travel to an exit.
Exception: Means of egress are not prohibited through adjoining or intervening rooms or spaces in a Group H, S or F occupancy when the adjoining or intervening rooms or spaces are the same or a lesser hazard occupancy group.
2. An exit access shall not pass through a room that can be locked to prevent egress.
3. Means of egress from dwelling units or sleeping areas shall not lead through other sleeping areas, toilet rooms or bathrooms.
4. Egress shall not pass through kitchens, storage rooms, closets or spaces used for similar purposes.
If the path to the exit is clear then it should be OK