qeth: HiperSockets Network Traffic Analyzer
New feature to trace HiperSockets network traffic for debugging purposes. Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com> Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
ab8932f3e8
commit
76b11f8e27
@@ -118,7 +118,7 @@ static ssize_t qeth_dev_portno_store(struct device *dev,
|
||||
{
|
||||
struct qeth_card *card = dev_get_drvdata(dev);
|
||||
char *tmp;
|
||||
unsigned int portno;
|
||||
unsigned int portno, limit;
|
||||
|
||||
if (!card)
|
||||
return -EINVAL;
|
||||
@@ -128,9 +128,11 @@ static ssize_t qeth_dev_portno_store(struct device *dev,
|
||||
return -EPERM;
|
||||
|
||||
portno = simple_strtoul(buf, &tmp, 16);
|
||||
if (portno > QETH_MAX_PORTNO) {
|
||||
if (portno > QETH_MAX_PORTNO)
|
||||
return -EINVAL;
|
||||
limit = (card->ssqd.pcnt ? card->ssqd.pcnt - 1 : card->ssqd.pcnt);
|
||||
if (portno > limit)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
card->info.portno = portno;
|
||||
return count;
|
||||
|
Reference in New Issue
Block a user