From bd0366287e90c19cc05c0b26e7eb5c04fff07663 Mon Sep 17 00:00:00 2001 From: Tzafrir Cohen Date: Wed, 6 Nov 2013 20:01:55 +0200 Subject: [PATCH] xpp: Fail loading if no module on first slot The driver assumes that the first slot is not empty. If this is not the case, synchronization will not work. Fail loading if this assertion does not hold. Signed-off-by: Tzafrir Cohen --- drivers/dahdi/xpp/card_global.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/dahdi/xpp/card_global.c b/drivers/dahdi/xpp/card_global.c index 3ed82e2..f743e62 100644 --- a/drivers/dahdi/xpp/card_global.c +++ b/drivers/dahdi/xpp/card_global.c @@ -511,6 +511,11 @@ HANDLER_DEF(GLOBAL, AB_DESCRIPTION) ret = -EPROTO; goto proto_err; } + if (units[0].addr.unit != 0 || units[0].addr.subunit != 0) { + XBUS_NOTICE(xbus, "No first module. Astribank unusable.\n"); + ret = -EPROTO; + goto proto_err; + } if (!xbus_setstate(xbus, XBUS_STATE_RECVD_DESC)) { ret = -EPROTO; goto proto_err;