CHROMIUM: img-rogue/1.13: fix refcount overflow in DevmemIntReserveRange()

There was a possible theoretical overflow of reference count in
DevmemIntReserveRange(). This change adds bound checks when referencing
the device memory heap to prevent the overflow.

BUG=b:217211551 b:224686498
TEST=none

Signed-off-by: Luigi Santivetti <luigi.santivetti@imagination.corp-partner.google.com>
Change-Id: If62ad65aad5428fc8dc4af484d916c7771f1606a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/3614221
Tested-by: Eizan Miyamoto <eizan@chromium.org>
Commit-Queue: Eizan Miyamoto <eizan@chromium.org>
Reviewed-by: Mani Milani <mani@chromium.org>
3 files changed