SAN FRANCISCO — If police departments want to line their budgets with drug money, they’d better do it right, according to the Ninth Circuit U.S. Court of Appeals.

In a ruling Tuesday, Judge Richard Clifton ordered the feds to return nearly $200,000 to a Los Angeles medical cannabis collective. Local police raided the place in 2005, and the seized funds became subject to asset forfeiture proceedings. Clifton found that under the Fourth Amendment, a faulty warrant means the police can’t keep the money.