Doubt by Nishith Patel

sir why we have taken moment of inertia of a cylinder mr2/2 because it is moment of inertia about centre of solid cylinder but in question spring is attached tangentially