If you’ll notice, he called the code garbage, not the author. Judging by how bad the code was, I think this interaction was fine. This actually shows the progress Linus made in improving himself.
But you got to give it to him, he does seem to be really good at catching deficiensies early that may accumulate to become serious bugs or security vulnerabilities in the future. Sure, being an asshole is not ok, but being assertive is a must for a person in his position.
https://lore.kernel.org/lkml/CAHk-=wjLCqUUWd8DzG+xsOn-yVL0Q=...