aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ehea/ehea_main.c
diff options
context:
space:
mode:
authorThomas Klein <osstklei@de.ibm.com>2007-06-06 14:53:16 -0400
committerJeff Garzik <jeff@garzik.org>2007-06-09 18:25:35 -0400
commitdec590c1bb05c1553b68cab7aa3ea36d77e7f9a3 (patch)
tree21dc9d1744e99a4291986e28036da0713a4a0616 /drivers/net/ehea/ehea_main.c
parent0d04761d17976ce560a22d9a21af575cd0d1bc21 (diff)
ehea: Fixed possible kernel panic on VLAN packet recv
This patch fixes a possible kernel panic due to not checking the vlan group when processing received VLAN packets and a malfunction in VLAN/hypervisor registration. Signed-off-by: Thomas Klein <tklein@de.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/ehea/ehea_main.c')
-rw-r--r--drivers/net/ehea/ehea_main.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index 152bb2016a2c..9e13433a268a 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -451,7 +451,8 @@ static struct ehea_cqe *ehea_proc_rwqes(struct net_device *dev,
451 processed_rq3++; 451 processed_rq3++;
452 } 452 }
453 453
454 if (cqe->status & EHEA_CQE_VLAN_TAG_XTRACT) 454 if ((cqe->status & EHEA_CQE_VLAN_TAG_XTRACT)
455 && port->vgrp)
455 vlan_hwaccel_receive_skb(skb, port->vgrp, 456 vlan_hwaccel_receive_skb(skb, port->vgrp,
456 cqe->vlan_tag); 457 cqe->vlan_tag);
457 else 458 else
@@ -1910,10 +1911,7 @@ static void ehea_vlan_rx_register(struct net_device *dev,
1910 goto out; 1911 goto out;
1911 } 1912 }
1912 1913
1913 if (grp) 1914 memset(cb1->vlan_filter, 0, sizeof(cb1->vlan_filter));
1914 memset(cb1->vlan_filter, 0, sizeof(cb1->vlan_filter));
1915 else
1916 memset(cb1->vlan_filter, 0xFF, sizeof(cb1->vlan_filter));
1917 1915
1918 hret = ehea_h_modify_ehea_port(adapter->handle, port->logical_port_id, 1916 hret = ehea_h_modify_ehea_port(adapter->handle, port->logical_port_id,
1919 H_PORT_CB1, H_PORT_CB1_ALL, cb1); 1917 H_PORT_CB1, H_PORT_CB1_ALL, cb1);
@@ -1947,7 +1945,7 @@ static void ehea_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)
1947 } 1945 }
1948 1946
1949 index = (vid / 64); 1947 index = (vid / 64);
1950 cb1->vlan_filter[index] |= ((u64)(1 << (vid & 0x3F))); 1948 cb1->vlan_filter[index] |= ((u64)(0x8000000000000000 >> (vid & 0x3F)));
1951 1949
1952 hret = ehea_h_modify_ehea_port(adapter->handle, port->logical_port_id, 1950 hret = ehea_h_modify_ehea_port(adapter->handle, port->logical_port_id,
1953 H_PORT_CB1, H_PORT_CB1_ALL, cb1); 1951 H_PORT_CB1, H_PORT_CB1_ALL, cb1);
@@ -1982,7 +1980,7 @@ static void ehea_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
1982 } 1980 }
1983 1981
1984 index = (vid / 64); 1982 index = (vid / 64);
1985 cb1->vlan_filter[index] &= ~((u64)(1 << (vid & 0x3F))); 1983 cb1->vlan_filter[index] &= ~((u64)(0x8000000000000000 >> (vid & 0x3F)));
1986 1984
1987 hret = ehea_h_modify_ehea_port(adapter->handle, port->logical_port_id, 1985 hret = ehea_h_modify_ehea_port(adapter->handle, port->logical_port_id,
1988 H_PORT_CB1, H_PORT_CB1_ALL, cb1); 1986 H_PORT_CB1, H_PORT_CB1_ALL, cb1);