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

Benjamin Herrenschmidt benh at kernel.crashing.org
Tue Nov 22 13:13:33 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 afb7a82..cf7f932 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.7.4



More information about the Skiboot mailing list