The locking ranges count and the array items are always ignored unless Single User Mode (SUM) is requested in the activate method. It is useless to enforce limits of unused array in the non-SUM case. Signed-off-by: Ondrej Kozina --- block/sed-opal.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/sed-opal.c b/block/sed-opal.c index 37746801479c..a26a94642d84 100644 --- a/block/sed-opal.c +++ b/block/sed-opal.c @@ -2942,7 +2942,8 @@ static int opal_activate_lsp(struct opal_dev *dev, }; int ret; - if (!opal_lr_act->num_lrs || opal_lr_act->num_lrs > OPAL_MAX_LRS) + if (opal_lr_act->sum && + (!opal_lr_act->num_lrs || opal_lr_act->num_lrs > OPAL_MAX_LRS)) return -EINVAL; ret = opal_get_key(dev, &opal_lr_act->key); -- 2.52.0