If your friend left mainland for HK legally, no need to worry about that.
The officer at China customs may check the stamps on the passport.
If no stamp to prove your friend left China legally, he/she will be fined.
Otherwise no need to worry about that at all.