Disclosed is a frequency converter with cooling for an electric motor that drives a hydrostatic pump. The cooling takes place via the working pressure medium that is delivered by the pump. A channel of the cooling system can form a portion of the hydraulic circuit which is supplied by the pump, or the working pressure medium is extracted from a tank and delivered to an extra cooling circuit line.