Message ID | 1578338508-13424-2-git-send-email-debmc@linux.ibm.com |
---|---|
State | New, archived |
Headers | show |
Series | ipmi-hiomap: Enablement for Async opal_flash_op's | expand |
Context | Check | Description |
---|---|---|
snowpatch_ozlabs/apply_patch | success | Successfully applied on branch master (d75e82dbfbb9443efeb3f9a5921ac23605aab469) |
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot | success | Test snowpatch/job/snowpatch-skiboot on branch master |
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot-dco | success | Signed-off-by present |
diff --git a/core/flash.c b/core/flash.c index 7fbfca2..2f041db 100644 --- a/core/flash.c +++ b/core/flash.c @@ -10,6 +10,7 @@ #include <skiboot.h> #include <cpu.h> +#include <inttypes.h> #include <lock.h> #include <opal.h> #include <opal-msg.h> @@ -436,8 +437,10 @@ static int64_t opal_flash_op(enum flash_op op, uint64_t id, uint64_t offset, goto err; } - if (size >= flash->size || offset >= flash->size + if (size > flash->size || offset >= flash->size || offset + size > flash->size) { + prlog(PR_DEBUG, "Requested flash op %d beyond flash size %" PRIu64 "\n", + op, flash->size); rc = OPAL_PARAMETER; goto err; }