They could be related, ,but it could head gaskets leaking and the issue that makes p0298 happen.
OBD2 Code P0298 Subaru definition:Indicates the Engine Oil Temperature Protection (EOT) strategy in the Power Train Control Module (PCM) has been activated. This temporarily prohibits high engine speed operation by disabling injectors, reducing the risk of engine damage from high engine oil temperature. Note: On engines which are equipped with an oil temperature sensor, the PCM reads oil temperature to determine if it is excessive. When an oil temperature sensor is not present, the PCM uses an oil algorithm to infer actual temperature. Engine shutdown strategy function is the same on vehicles with and without oil temperature sensors.