Over contributed to our child's Roth IRA last year and just realized it. How do we correct our mistake?

Our son graduated from college in May, 2017 and didn't work the entire year, thus he received no W2 and didn't file taxes in 2017. Unfortunately, we gifted him 5500 and deposited it in a Roth IRA without thinking about the fact he hadn't earned any income that year. How do we correct that now? Do we go back and file for 2017 now and pay the penalty with that fileing? Do we need to remove the money from the Roth-IRA now as well, or can we apply it to what he will contribute this year? He will be filing this year and has earned more than the 5500 we contributed last year.