From: Alexey Khoroshilov <khoroshilov@ispras.ru>
To: David Miller <davem@davemloft.net>
Cc: kevin.curtis@farsite.co.uk, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, ldv-project@linuxtesting.org
Subject: Re: [PATCH] farsync: fix invalid memory accesses in fst_add_one() and fst_init_card()
Date: Tue, 08 Jul 2014 18:40:32 -0400 [thread overview]
Message-ID: <53BC7360.6050000@ispras.ru> (raw)
In-Reply-To: <20140708.152057.490185410038470309.davem@davemloft.net>
On 08.07.2014 18:20, David Miller wrote:
> From: Alexey Khoroshilov <khoroshilov@ispras.ru>
> Date: Sat, 5 Jul 2014 03:35:50 +0400
>
>> - }
>> + card->nports = i;
>> + return (card->nports == 0) ? err : 0;
>> + }
> I don't think this is the right thing to do.
>
> This will cause the caller to not free the IRQ or any of the
> other resources.
My understanding of the existing code is to proceed if at least one port
is available.
So I return error code if no ports available at all, otherwise
initialization continues and can succeed.
If something else goes wrong, all resources are deallocated.
Do you suggest to return error code unconditionally?
--
Alexey
next prev parent reply other threads:[~2014-07-08 22:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-04 23:35 [PATCH] farsync: fix invalid memory accesses in fst_add_one() and fst_init_card() Alexey Khoroshilov
2014-07-08 22:20 ` David Miller
2014-07-08 22:40 ` Alexey Khoroshilov [this message]
2014-07-08 23:20 ` David Miller
2014-07-10 22:43 ` [PATCH v2] " Alexey Khoroshilov
2014-07-11 20:38 ` David Miller
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=53BC7360.6050000@ispras.ru \
--to=khoroshilov@ispras.ru \
--cc=davem@davemloft.net \
--cc=kevin.curtis@farsite.co.uk \
--cc=ldv-project@linuxtesting.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox