]> git.baikalelectronics.ru Git - kernel.git/commit
net/cxgb4: Fix referencing freed adapter
authorGavin Shan <shangw@linux.vnet.ibm.com>
Fri, 24 Jan 2014 09:12:03 +0000 (17:12 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 25 Jan 2014 00:00:37 +0000 (16:00 -0800)
commit68079ba174a6ac6aff5975bad3baefa57aab6166
tree769c0d31b2b0b5dbcd24ea8f82ece34dc3367913
parent72a853da51c157f4b848b17c2b9f4760d443040e
net/cxgb4: Fix referencing freed adapter

The adapter is freed before we check its flags. It was caused
by commit c02e3b7 ("net/cxgb4: Avoid disabling PCI device for
towice"). The problem was reported by Intel's "0-day" tool.

The patch fixes it to avoid reverting commit c02e3b7.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c