fix a bug in portalmem driver

Change-Id: I3f39a8d02a7df38ac060fb9a9cc020024917ef5d