Do you realize that the EGR malfunctioning not only raises the NOx emission from your car but also increases its chances for knocking? Not that repairing the EGR will cure your knock sensor code, but it can help your mileage if the knock sensor(s) are working and detect knock that results from an inop EGR. Hope that makes as much sense to you as I intended.