Wiktionary
give someone what for
vb. (context idiomatic slang English) To punish; to rebuke.
vb. (context idiomatic slang English) To punish; to rebuke.