netdev
[Top] [All Lists]

Bug in qeth in 2.6

To: cohuck@xxxxxxxxxx
Subject: Bug in qeth in 2.6
From: Pete Zaitcev <zaitcev@xxxxxxxxxx>
Date: Wed, 3 Sep 2003 14:54:44 -0400
Cc: netdev@xxxxxxxxxxx, zaitcev@xxxxxxxxxx
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mutt/1.2.5.1i
This code is obviously broken in case several cards are present,
look what happens to ``result''.

devices/s390/net/qeth.c:

static int
qeth_verify_dev(struct net_device *dev)
{
        struct qeth_card *tmp;
        int result = 0;
                                                                                
        read_lock(&list_lock);
        tmp = firstcard;
        for (; tmp && (!result); tmp = tmp->next) {
                if (atomic_read(&tmp->shutdown_phase))
                        continue;
                result = (dev == tmp->dev)?
                        QETH_VERIFY_IS_REAL_DEV:__qeth_verify_dev_vlan(dev, 
tmp);
        }
        read_unlock(&list_lock);
        return result;
}

Someone got seriously carried away with cleanups.
I have to say, I'm disappointed. The original qeth in 2.4
had poor C style, but it was a mistake to run amok adding
spaces. The diff between 2.4 and 2.6 is too hard to read,
even with -b. Now I have to review whole darn thing line by line.
Oh woe!

-- Pete

<Prev in Thread] Current Thread [Next in Thread>