Fix array overrun, reported by Coverity.

CID:		1229970
Remove uninitialized and unused variable, reported by Coverity.

CID:		1230015
Make ctl_port_mask an array to support more then 32 ports.

Overflow reported by Coverity.

CID:		1229894
MFC after:	3 days