L1 to H1 (COS) is not applied for but having valid I94

I am working to company A on L1B visa(I have valid I94 upto 2014sep ), due some problem I resigned to company A .

I have valid H1b Petition form company B, Company B is planning apply for COS after 2 weeks.

My question is

  1. Is my stay will become illegal because of already I resigned to Company A ? ,

Or I can stay until new I94 based on H1b visa ?