|
@@ -364,7 +364,7 @@ static int prism2_plx_check_cis(void __iomem *attr_mem, int attr_len,
|
|
|
|
|
|
pos = 0;
|
|
|
while (pos < CIS_MAX_LEN - 1 && cis[pos] != CISTPL_END) {
|
|
|
- if (pos + cis[pos + 1] >= CIS_MAX_LEN)
|
|
|
+ if (pos + 2 + cis[pos + 1] > CIS_MAX_LEN)
|
|
|
goto cis_error;
|
|
|
|
|
|
switch (cis[pos]) {
|
|
@@ -391,7 +391,7 @@ static int prism2_plx_check_cis(void __iomem *attr_mem, int attr_len,
|
|
|
break;
|
|
|
|
|
|
case CISTPL_MANFID:
|
|
|
- if (cis[pos + 1] < 5)
|
|
|
+ if (cis[pos + 1] < 4)
|
|
|
goto cis_error;
|
|
|
manfid1 = cis[pos + 2] + (cis[pos + 3] << 8);
|
|
|
manfid2 = cis[pos + 4] + (cis[pos + 5] << 8);
|