dev: Fix segfault in flash device
dev: Fix segfault in flash device

Fix a bug in which the flash device would write out of bounds and
could either trigger a segfault and corrupt the memory of other
objects. This was caused by using pageSize in the place of
pagesPerBlock when running the garbage collector.

Also, added an assert to flag this condition in the future.

Weil0ng/gem5,SanchayanMaity/gem5,TUD-OS/gem5-dtu,powerjg/gem5-ci-test,qizenguf/MLC-STT,HwisooSo/gemV-update,KuroeKurose/gem5,aclifton/cpeg853-gem5,HwisooSo/gemV-update,TUD-OS/gem5-dtu,sobercoder/gem5,gedare/gem5,rjschof/gem5,Weil0ng/gem5,cancro7/gem5,TUD-OS/gem5-dtu,SanchayanMaity/gem5,SanchayanMaity/gem5,briancoutinho0905/2dsampling,briancoutinho0905/2dsampling,briancoutinho0905/2dsampling,gedare/gem5,gem5/gem5,powerjg/gem5-ci-test,rallylee/gem5,powerjg/gem5-ci-test,aclifton/cpeg853-gem5,gedare/gem5,briancoutinho0905/2dsampling,rallylee/gem5,sobercoder/gem5,SanchayanMaity/gem5,gem5/gem5,cancro7/gem5,HwisooSo/gemV-update,gedare/gem5,aclifton/cpeg853-gem5,cancro7/gem5,powerjg/gem5-ci-test,rallylee/gem5,rjschof/gem5,powerjg/gem5-ci-test,cancro7/gem5,qizenguf/MLC-STT,aclifton/cpeg853-gem5,sobercoder/gem5,aclifton/cpeg853-gem5,HwisooSo/gemV-update,SanchayanMaity/gem5,SanchayanMaity/gem5,KuroeKurose/gem5,briancoutinho0905/2dsampling,sobercoder/gem5,rjschof/gem5,sobercoder/gem5,Weil0ng/gem5,qizenguf/MLC-STT,rallylee/gem5,Weil0ng/gem5,rjschof/gem5,cancro7/gem5,HwisooSo/gemV-update,KuroeKurose/gem5,cancro7/gem5,Weil0ng/gem5,qizenguf/MLC-STT,TUD-OS/gem5-dtu,rjschof/gem5,rallylee/gem5,TUD-OS/gem5-dtu,Weil0ng/gem5,KuroeKurose/gem5,briancoutinho0905/2dsampling,gedare/gem5,gem5/gem5,gedare/gem5,briancoutinho0905/2dsampling,rjschof/gem5,powerjg/gem5-ci-test,qizenguf/MLC-STT,cancro7/gem5,KuroeKurose/gem5,powerjg/gem5-ci-test,qizenguf/MLC-STT,HwisooSo/gemV-update,rallylee/gem5,Weil0ng/gem5,KuroeKurose/gem5,KuroeKurose/gem5,HwisooSo/gemV-update,SanchayanMaity/gem5,gem5/gem5,rjschof/gem5,TUD-OS/gem5-dtu,qizenguf/MLC-STT,gedare/gem5,gem5/gem5,TUD-OS/gem5-dtu,gem5/gem5,sobercoder/gem5,aclifton/cpeg853-gem5,aclifton/cpeg853-gem5,sobercoder/gem5,rallylee/gem5,gem5/gem5