Grant Gustin -- the guy who plays "The Flash" on the hit CW series -- wasn't so quick on his feet when he needed to find a way to relax while on a flight to Canada ... 'cause his plan went up in smoke.
We're told Grant was aboard Compass Airlines Flight 6006 Sunday night from LAX to Vancouver, sitting in first class. When the plane -- carrying 68 passengers -- leveled off, Grant headed straight to the bathroom and allegedly put his vaping pen to serious work.
Witnesses tell us the smoke coming outta the bathroom was so intense, it set off a smoke alarm after seeping into the cockpit ... where the captain and co-pilot were forced to wear oxygen masks.
Our sources say Grant -- who has also appeared on "Glee" and "Supergirl" -- copped to vaping. According to witnesses, he wanted to relax during the flight. We're told the flight attendants confiscated his vape without incident.
We're told the plane was NOT diverted ... and after landing in Vancouver, Grant was kept on the plane where he was met by Canadian authorities. As you probably know ... vaping on a flight is a huge no-no, but luckily for Grant, he was let off with a warning.
A rep with Compass Airlines tells TMZ ... flight 6006, "experienced a smoke indicator from the forward lavatory while in flight. A vaping pen was confiscated from a cooperative passenger. The flight landed safely in Vancouver, without delay."
We reached out to Grant's rep, who had no comment.