diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c index e3291dfa76075c38ecde0789a4b4838676a2f77d..2a6a4316db00bc38c55f114183e10f4a0c0dd220 100644 --- a/drivers/block/aoe/aoecmd.c +++ b/drivers/block/aoe/aoecmd.c @@ -1359,6 +1359,13 @@ aoecmd_cfg_rsp(struct sk_buff *skb) "Check shelf dip switches.\n"); return; } + if (h->minor >= NPERSHELF) { + pr_err("aoe: e%ld.%d %s, %d\n", + aoemajor, h->minor, + "slot number larger than the maximum", + NPERSHELF-1); + return; + } sysminor = SYSMINOR(aoemajor, h->minor); if (sysminor * AOE_PARTITIONS + AOE_PARTITIONS > MINORMASK) {