From: Nithin Nayak Sujir Date: Tue, 30 Aug 2011 22:54:50 +0000 (-0700) Subject: bnx2fc: Validate vlan id in NETDEV_UNREGISTER handler X-Git-Tag: v2.6.39-400.9.0~423^2~19^2~11^2~428 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=7a3a32aa146da2d4f1da01344f2f0d9ca9968491;p=users%2Fjedix%2Flinux-maple.git bnx2fc: Validate vlan id in NETDEV_UNREGISTER handler When bnx2fc receives an UNREGISTER event on a vlan interface it calls destroy on all interfaces that matches the physical interface. Add vlan_id check to destroy only the vlan interface that generated the event. Signed-off-by: Nithin Nayak Sujir Signed-off-by: Bhanu Prakash Gollapudi Signed-off-by: James Bottomley (cherry picked from commit 26b2982f78c1fc6f486a67271b1d0a0d305dd54b) Signed-off-by: Joe Jin --- diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c index 25ced7b9e544..0a610de546a4 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c +++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c @@ -839,9 +839,9 @@ static void bnx2fc_indicate_netevent(void *context, unsigned long event, return; mutex_lock(&bnx2fc_dev_lock); list_for_each_entry_safe(interface, tmp, &if_list, list) { - if (interface->hba != hba) - continue; - __bnx2fc_destroy(interface); + if (interface->hba == hba && + interface->vlan_id == (vlan_id & VLAN_VID_MASK)) + __bnx2fc_destroy(interface); } mutex_unlock(&bnx2fc_dev_lock); return;