diff mbox

[33/60] xive: Don't assert if xive_get_vp() fails

Message ID 20161222031708.18752-33-benh@kernel.crashing.org
State Accepted
Headers show

Commit Message

Benjamin Herrenschmidt Dec. 22, 2016, 3:16 a.m. UTC
Just return NULL to the caller

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 hw/xive.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/hw/xive.c b/hw/xive.c
index 2a0d234..5476a97 100644
--- a/hw/xive.c
+++ b/hw/xive.c
@@ -761,7 +761,8 @@  static struct xive_vp *xive_get_vp(struct xive *x, unsigned int idx)
 	assert(idx < (x->vp_ind_count * VP_PER_PAGE));
 	p = (struct xive_vp *)(x->vp_ind_base[idx / VP_PER_PAGE] &
 			       VSD_ADDRESS_MASK);
-	assert(p);
+	if (!p)
+		return NULL;
 
 	return &p[idx % VP_PER_PAGE];
 #else