Skip to content

Commit

Permalink
[PATCH] IB/ipath: check for valid LID and multicast LIDs
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bryan O'Sullivan authored and Linus Torvalds committed Jul 1, 2006
1 parent 7cd658c commit 8532294
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/infiniband/hw/ipath/ipath_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 8532294

Please sign in to comment.