Brandon Davis pled guilty to felony possession of cocaine -- two months after police arrested ol' Greasy Bear outside a Hollywood nightclub ... and found the drug in his pocket.
As we previously reported, Brandon was busted outside Beacher's Madhouse back in April -- after he allegedly punched comedian Ben Gleib in the face.
When cops arrived, they searched Davis and found cocaine. Brandon was arrested for battery and possession of a controlled substance.
Brandon pled no contest to the battery charge -- a misdemeanor, and the judge sentenced him to a drug diversion program.
Good news -- if Brandon successfully completes the program, both charges will be dropped entirely.