This is a good catch, and I think this is the right solution. One question: does the mutex use in mthca_multicast_detach() suffer from the same problem? It seems that we might call to detach from a multicast group during process exit with a signal pending, and end up failing there when we shouldn't. - R.