A federal appeals court in Virginia has refused to revive a lawsuit by former racecar driver Jeremy Mayfield's against NASCAR over his suspension for failing a random drug test.

A three-judge panel of the 4th U.S. Circuit Court of Appeals unanimously ruled Monday that U.S. District Judge Graham Mullen in Charlotte, N.C., did not abuse his discretion in dismissing Mayfield's complaint.

After his 2009 suspension, Mayfield sued NASCAR; its owner, Brian Zachary France; and a drug testing company for defamation, unfair and deceptive trade practices, breach of contract and negligence. Mullen tossed out the suit because Mayfield had, as a driver and an owner, signed documents waiving his right to sue.

Mayfield has argued that over-the-counter and prescription medications led to the positive test at Richmond International Raceway.

“NASCAR is pleased that today the U.S. Court of Appeals for the Fourth Circuit affirmed the U.S. District Court’s original decision in May 2010 in Jeremy Mayfield v. NASCAR," said Steve O’Donnell, NASCAR Senior Vice President, Racing Operations, in a statement issued Monday afternoon.

"This case was never about anything more than NASCAR’s ability to keep the sport clean and our competitors safe.”