From: Bryan O'Sullivan Date: Sat, 1 Jul 2006 11:36:08 +0000 (-0700) Subject: [PATCH] IB/ipath: check for valid LID and multicast LIDs X-Git-Tag: v2.6.18-rc1~219 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=85322947d761d08bd84165500f35b93c702aaaf3;p=linux-2.6 [PATCH] IB/ipath: check for valid LID and multicast LIDs Signed-off-by: Ralph Campbell Signed-off-by: Bryan O'Sullivan Cc: "Michael S. Tsirkin" Cc: Roland Dreier Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/infiniband/hw/ipath/ipath_sysfs.c b/drivers/infiniband/hw/ipath/ipath_sysfs.c index 450c09ea5b..ccff629278 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, 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;