Take another look at the sentence:
Walking into the tree, a participle phrase, comes right before shirt, an illogical target. Kareem, not the shirt, is the one with legs that can walk! [Kareem's, a possessive noun, functions as an adjective, as do old and holey, describing shirt.]
Before you continue, review the rules for misplaced and dangling modifiers.