mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-12 08:48:48 +00:00
[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>
This commit is contained in:
parent
7cd658cd2b
commit
85322947d7
@ -280,7 +280,7 @@ static ssize_t store_lid(struct device *dev,
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto invalid;
|
goto invalid;
|
||||||
|
|
||||||
if (lid == 0 || lid >= 0xc000) {
|
if (lid == 0 || lid >= IPS_MULTICAST_LID_BASE) {
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
goto invalid;
|
goto invalid;
|
||||||
}
|
}
|
||||||
@ -314,7 +314,7 @@ static ssize_t store_mlid(struct device *dev,
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = ipath_parse_ushort(buf, &mlid);
|
ret = ipath_parse_ushort(buf, &mlid);
|
||||||
if (ret < 0)
|
if (ret < 0 || mlid < IPS_MULTICAST_LID_BASE)
|
||||||
goto invalid;
|
goto invalid;
|
||||||
|
|
||||||
unit = dd->ipath_unit;
|
unit = dd->ipath_unit;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user