summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorWei Yang <weiyang@linux.vnet.ibm.com>2013-05-22 15:58:22 +0000
committerDavid S. Miller <davem@davemloft.net>2013-05-23 18:56:40 -0700
commit950e2958a5e96406e6e5ff4190a638a54769f89b (patch)
treed403eafd55d2c20e1786d37edc677994d5a5ecf5 /net
parent547669d483e5783d722772af1483fa474da7caf9 (diff)
downloadop-kernel-dev-950e2958a5e96406e6e5ff4190a638a54769f89b.zip
op-kernel-dev-950e2958a5e96406e6e5ff4190a638a54769f89b.tar.gz
be2net: bug fix on returning an invalid nic descriptor
In function be_get_nic_desc(), it will go through the descriptor array returned from f/w. By comparing the desc_type field, it determines whether there is a nic descriptor in the array or not. In the case of no nic descriptor, this function should return NULL. The code may return an invalide descriptor, when there is no nic descriptor in the array and the desc_count is less than MAX_RESOURCE_DESC. In this case, even there is no nic descriptor, it will still return the lase descriptor since the i doesn't equal to MAX_RESOURCE_DESC. This patch fix this issue by returning the descriptor when find it and return NULL for other cases. Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com> Reviewed-by: Gavin Shan <shangw@linux.vnet.ibm.com> Reviewed-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com> Acked-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud