Fix things up.

	1. Fix locks.
	2. Fix attach logic.
	3. Fix detach bus.

	modified:   mm/ssmem.c
remove unused variable