]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/block/aoe/aoecmd.c
aoe: disallow unsupported AoE minor addresses
[karo-tx-linux.git] / drivers / block / aoe / aoecmd.c
index af2e3479b884dbdb41e4a061941211bf55a5ca4b..9fe5e9170d90bf5898164bfe5d54a52a3639a799 100644 (file)
@@ -1358,6 +1358,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) {