A locking device for securing a heat sink to a heat generating electronic device includes a retaining member attached to the heat sink and a plurality of fasteners positioned to the retaining member. The retaining member includes a frame and a plurality of fastening feet integrally formed with the frame by metal extrusion. The frame has an opening for receiving a bottom protrusion of the heat sink therein. Each fastening foot has a slot therein communicating with the opening of the frame and defines a fastening hole. The fasteners are respectively positioned in the fastening holes of the fastening feet of the retaining member.