Are you saying you failed the state mandated smog inspection? If so here is why. There are emission "monitors" which the powertrain control module (PCM) must run before the smog inspection will pass no matter what the tail pipe readings are. This system is not special to your 2005 Chevrolet Malibu. This is mandated by the federal government and all vehicles sold in the US since 1996 are so equipted. Disconnecting the battery can sometimes cause the PCM to reset all its emission monitors. Normal driving (city and highway) for a few days (about 30 miles) should cause the emission monitors to run and allow you to pass your smog inspection if everything else is OK.