SAN FRANCISCO — The ongoing legal battle between McAfee Inc. and its former general counsel over stock option backdating allegations is over.

Kent Roberts and McAfee have agreed to settle the defamation and malicious prosecution lawsuit that he filed against it in 2009, according to court documents filed Monday.