This is a judgment from 1970. The case is S.M. Sharma Vs. Bipen Kumar Tiwari.
Here is an excerpt:
“It appears to us that, though the Code of Criminal Procedure gives to the police unfettered power to investigate all cases where they suspect that a cognizable offence has been committed, in appropriate cases an aggrieved person can always seek a remedy by invoking the power of the High Court under Article 226 of the Constitution under which, if the High Court could be convinced that the power of investigation has been exercised by a police officer mala fide, the High Court can always issue a writ of mandamus restraining the police officer from misusing his legal power”
Here is the judgment: Restraining A Police Officer From Abusing His Powers