aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBryan O'Sullivan <bos@pathscale.com>2006-07-01 07:36:08 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-01 12:56:01 -0400
commit85322947d761d08bd84165500f35b93c702aaaf3 (patch)
tree22bdbdedcf877e4c9acc6b6f100d8c88cce7dc70 /drivers
parent7cd658cd2bca48d3a0e747b4525c72eb8855278e (diff)
[PATCH] IB/ipath: check for valid LID and multicast LIDs
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/infiniband/hw/ipath/ipath_sysfs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_sysfs.c b/drivers/infiniband/hw/ipath/ipath_sysfs.c
index 450c09ea5bc1..ccff629278a4 100644
--- a/drivers/infiniband/hw/ipath/ipath_sysfs.c
+++ b/drivers/infiniband/hw/ipath/ipath_sysfs.c
@@ -280,7 +280,7 @@ static ssize_t store_lid(struct device *dev,
280 if (ret < 0) 280 if (ret < 0)
281 goto invalid; 281 goto invalid;
282 282
283 if (lid == 0 || lid >= 0xc000) { 283 if (lid == 0 || lid >= IPS_MULTICAST_LID_BASE) {
284 ret = -EINVAL; 284 ret = -EINVAL;
285 goto invalid; 285 goto invalid;
286 } 286 }
@@ -314,7 +314,7 @@ static ssize_t store_mlid(struct device *dev,
314 int ret; 314 int ret;
315 315
316 ret = ipath_parse_ushort(buf, &mlid); 316 ret = ipath_parse_ushort(buf, &mlid);
317 if (ret < 0) 317 if (ret < 0 || mlid < IPS_MULTICAST_LID_BASE)
318 goto invalid; 318 goto invalid;
319 319
320 unit = dd->ipath_unit; 320 unit = dd->ipath_unit;