First and foremost, I take it you were a passenger and therefore did not commit any crime or vehicle violation, therefore, the police had no reason to search you and if the search was illegal under the Fourth Amendment the cannabis can not be used as evidence against you.
But from a practical standpoint, because you didn't violate any laws before the seizure, I don't think anything will happen to you. Frequently, police will take the drugs, but if it's a small amount for personal use and if its weed, you probably won't be charged. Because you were not "arrested" or charged with any crime, don't tell probation officers about this incident because you weren't driving and the therefore never charged with a crime or an infraction. I think you'll be OKwith your probation situation. Meanwhile, don't discuss this case with anybody. I don't think the district attorney will prosecute you given the circumstances you described.