LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Arne Redlich <arne.redlich@xiranet.com>
To: Erez Zilber <erezz@voltaire.com>
Cc: Roland Dreier <rolandd@cisco.com>,
	ofa-general <general@lists.openfabrics.org>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] IB/iSER: fix list iteration bug
Date: Tue, 04 Mar 2008 16:41:20 +0100	[thread overview]
Message-ID: <878x0yfqe7.fsf@confield.dd.xiranet.com> (raw)
In-Reply-To: <47CD3B7A.2010106@voltaire.com> (Erez Zilber's message of "Tue, 04 Mar 2008 14:07:22 +0200")

Erez Zilber <erezz@voltaire.com> writes:

> Arne Redlich wrote:
>> The iteration through the list of "iser_device"s during device
>> lookup/creation is broken - it might result in an infinite loop if more
>> than 1 HCA is used with iSER. Use list_for_each_entry() instead of the
>> custom, flawed list iteration code.
>> 
>> Signed-off-by: Arne Redlich <arne.redlich@xiranet.com>
>> ---
>>  drivers/infiniband/ulp/iser/iser_verbs.c |   36 ++++++++++++-----------------
>>  1 files changed, 15 insertions(+), 21 deletions(-)
>> 
>> diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c
>> index 714b8db..1c0f968 100644
>> --- a/drivers/infiniband/ulp/iser/iser_verbs.c
>> +++ b/drivers/infiniband/ulp/iser/iser_verbs.c
>> @@ -237,33 +237,27 @@ static int iser_free_ib_conn_res(struct iser_conn *ib_conn)
>>  static
>>  struct iser_device *iser_device_find_by_ib_device(struct rdma_cm_id *cma_id)
>>  {
>> -	struct list_head    *p_list;
>> -	struct iser_device  *device = NULL;
>> +	struct iser_device *device;
>>  
>>  	mutex_lock(&ig.device_list_mutex);
>>  
>> -	p_list = ig.device_list.next;
>> -	while (p_list != &ig.device_list) {
>> -		device = list_entry(p_list, struct iser_device, ig_list);
>> -		/* find if there's a match using the node GUID */
>> +	list_for_each_entry(device, &ig.device_list, ig_list)
>
> I've just added the original comments that are missing in your patch.

Ah well, I probably should've mentioned in the patch description that I
intentionally removed those comments as I think they're really
redundant, stating the obvious. But of course I won't insist. :)

Thanks,
Arne

  reply	other threads:[~2008-03-04 15:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-03 10:36 Arne Redlich
2008-03-04 12:07 ` Erez Zilber
2008-03-04 15:41   ` Arne Redlich [this message]
2008-03-05  6:26     ` Erez Zilber
2008-03-11  4:16   ` Roland Dreier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878x0yfqe7.fsf@confield.dd.xiranet.com \
    --to=arne.redlich@xiranet.com \
    --cc=erezz@voltaire.com \
    --cc=general@lists.openfabrics.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rolandd@cisco.com \
    --subject='Re: [PATCH 1/2] IB/iSER: fix list iteration bug' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).