@@ -4222,7 +4222,10 @@ static int64_t opal_xive_free_vp_block(uint64_t vp_base)
struct xive *x;
struct xive_vp *vp;
- xive_decode_vp(vp_id, &blk, &idx, NULL, NULL);
+ if (!xive_decode_vp(vp_id, &blk, &idx, NULL, NULL)) {
+ prerror("XIVE: Couldn't decode VP id %u\n", vp_id);
+ return OPAL_INTERNAL_ERROR;
+ }
x = xive_from_pc_blk(blk);
if (!x) {
prerror("XIVE: Instance not found for deallocated VP"
@@ -4289,7 +4292,10 @@ static int64_t opal_xive_alloc_vp_block(uint32_t alloc_order)
struct xive *x;
struct xive_vp *vp;
- xive_decode_vp(vp_id, &blk, &idx, NULL, NULL);
+ if (!xive_decode_vp(vp_id, &blk, &idx, NULL, NULL)) {
+ prerror("XIVE: Couldn't decode VP id %u\n", vp_id);
+ return OPAL_INTERNAL_ERROR;
+ }
x = xive_from_pc_blk(blk);
if (!x) {
prerror("XIVE: Instance not found for allocated VP"
While it is likely that a failure of xive_decode_vp() would simply trip an error condition later on, it makes sense to check for errors earlier and print a (hopefully) more relevant error message. Fixes: CID 142343 and 142344 Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> --- hw/xive.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)