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

Benjamin Herrenschmidt benh at kernel.crashing.org
Thu Dec 22 14:16:41 AEDT 2016


Just return NULL to the caller

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

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
-- 
2.9.3



More information about the Skiboot mailing list