[PATCH] IB/ipath: check for valid LID and multicast LIDs
authorBryan O'Sullivan <bos@pathscale.com>
Sat, 1 Jul 2006 11:36:08 +0000 (04:36 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sat, 1 Jul 2006 16:56:01 +0000 (09:56 -0700)
Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Cc: "Michael S. Tsirkin" <mst@mellanox.co.il>
Cc: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/infiniband/hw/ipath/ipath_sysfs.c

index 450c09ea5bc1652cb228170767988dca62337790..ccff629278a4f894b7e721b3565bca58b464e6bd 100644 (file)
@@ -280,7 +280,7 @@ static ssize_t store_lid(struct device *dev,
        if (ret < 0)
                goto invalid;
 
-       if (lid == 0 || lid >= 0xc000) {
+       if (lid == 0 || lid >= IPS_MULTICAST_LID_BASE) {
                ret = -EINVAL;
                goto invalid;
        }
@@ -314,7 +314,7 @@ static ssize_t store_mlid(struct device *dev,
        int ret;
 
        ret = ipath_parse_ushort(buf, &mlid);
-       if (ret < 0)
+       if (ret < 0 || mlid < IPS_MULTICAST_LID_BASE)
                goto invalid;
 
        unit = dd->ipath_unit;