From: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Sony Chacko <sony.chacko@qlogic.com>,
Dept-Eng Linux Driver <Linux-Driver@qlogic.com>,
netdev <netdev@vger.kernel.org>,
"kernel-janitors@vger.kernel.org"
<kernel-janitors@vger.kernel.org>
Subject: Re: [patch] qlcnic: off by one in qlcnic_init_pci_info()
Date: Thu, 14 Jun 2012 21:03:14 -0700 [thread overview]
Message-ID: <CC000197.32F56%anirban.chakraborty@qlogic.com> (raw)
In-Reply-To: <20120614183424.GC6383@elgon.mountain>
On 6/14/12 11:34 AM, "Dan Carpenter" <dan.carpenter@oracle.com> wrote:
>The adapter->npars[] array has QLCNIC_MAX_PCI_FUNC elements. We
>allocate it that way a few lines earlier in the function. So this test
>is off by one.
>
>Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
>diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
>b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
>index 33c3e46..212c121 100644
>--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
>+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
>@@ -479,7 +479,7 @@ qlcnic_init_pci_info(struct qlcnic_adapter *adapter)
>
> for (i = 0; i < QLCNIC_MAX_PCI_FUNC; i++) {
> pfn = pci_info[i].id;
>- if (pfn > QLCNIC_MAX_PCI_FUNC) {
>+ if (pfn >= QLCNIC_MAX_PCI_FUNC) {
> ret = QL_STATUS_INVALID_PARAM;
> goto err_eswitch;
> }
Thanks for the patch.
Acked-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
next prev parent reply other threads:[~2012-06-15 4:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-14 18:34 [patch] qlcnic: off by one in qlcnic_init_pci_info() Dan Carpenter
2012-06-15 4:03 ` Anirban Chakraborty [this message]
2012-06-15 22:31 ` 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=CC000197.32F56%anirban.chakraborty@qlogic.com \
--to=anirban.chakraborty@qlogic.com \
--cc=Linux-Driver@qlogic.com \
--cc=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sony.chacko@qlogic.com \
/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;
as well as URLs for NNTP newsgroup(s).