In a strange ordeal, I had just finally restored my friend's iPhone
After many tests, restores, DFU restores and baseband flashes to try and get him back on 1.1.1 unlocked, I resorted to flashing it to factory 1.0.2 status and unlocking it with anySIM 1.1
The problem is that his wifi tends to freeze/crash the phone when it's connected to an access point.

I figure it can be a hardware fault, but then if you just turn wifi on, 90% of the time it will work fine not connected to any access point. Once connected to my wifi, it either freezes the phone after using it for a couple of seconds or restarts the phone and puts it in a restart loop (presumably because it keeps trying to connect to the point once booted)

I figure it can also be a software fault, but DFU restores should have fixed that problem.
That is, unless some things don't get touched on the phone and my guess is some sort of wifi framework or something of the sort is corrupted, but restore isn't fixing it. Unless I'm wrong.

It's fine with wifi off on 1.0.2, but I'd really like to get to the bottom of this problem (hardware or software)

If anyone has any insight, feel free to chip in some ideas, Thanks!