Not really beyond a) they both died and b) they both worked in the field of security. Any further comparison is a little contrived.
Gareth Williams was never a hacker - he was an academic mathematician who later became employed by GCHQ. Unlike Barnaby's death, neither alcohol or drugs played any part in his death.
The circumstances around William's passing is legitimately suspicious, however, given the 'ritualistic placing of sim cards' and the fact that no one has been able to prove it is possible to lock oneself in the sports holdal from the inside.
[0]: http://en.wikipedia.org/wiki/Death_of_Gareth_Williams