From 21c99d2e47c6ea51681bef994214c17dfb91d73f Mon Sep 17 00:00:00 2001 From: Bhanu Prakash Gollapudi Date: Thu, 4 Aug 2011 17:38:39 -0700 Subject: [PATCH] --- yaml --- r: 270952 b: refs/heads/master c: cdf54668bc48193e43adc8f75ce419ce0ce50fc0 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 3c2d794f1b75..a8b4e48af94c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b65d457913d1c0644394287d5d834373f42fb99a +refs/heads/master: cdf54668bc48193e43adc8f75ce419ce0ce50fc0 diff --git a/trunk/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/trunk/drivers/scsi/bnx2fc/bnx2fc_fcoe.c index 9e2bf398ff91..21792e7eaeb2 100644 --- a/trunk/drivers/scsi/bnx2fc/bnx2fc_fcoe.c +++ b/trunk/drivers/scsi/bnx2fc/bnx2fc_fcoe.c @@ -1028,8 +1028,20 @@ static int bnx2fc_vport_destroy(struct fc_vport *vport) struct fc_lport *n_port = shost_priv(shost); struct fc_lport *vn_port = vport->dd_data; struct fcoe_port *port = lport_priv(vn_port); + struct fc_lport *v_port; + bool found = false; mutex_lock(&n_port->lp_mutex); + list_for_each_entry(v_port, &n_port->vports, list) + if (v_port->vport == vport) { + found = true; + break; + } + + if (!found) { + mutex_unlock(&n_port->lp_mutex); + return -ENOENT; + } list_del(&vn_port->list); mutex_unlock(&n_port->lp_mutex); queue_work(bnx2fc_wq, &port->destroy_work);