From: Ivan Vecera <ivecera@redhat.com>
To: Sathya Perla <sathya.perla@avagotech.com>
Cc: netdev@vger.kernel.org,
Sriharsha Basavapatna <sriharsha.basavapatna@avagotech.com>,
Ajit Kumar Khaparde <ajit.khaparde@avagotech.com>,
Padmanabh Ratnakar <padmanabh.ratnakar@avagotech.com>
Subject: Re: [PATCH net] be2net: check properly status in lancer_cmd_get_file_len()
Date: Mon, 16 Nov 2015 10:21:25 +0100 [thread overview]
Message-ID: <5649A015.5040701@redhat.com> (raw)
In-Reply-To: <CAKvpyk2qLc7gqd3mQ5oBpzG5QCnjQCawhx4kvsn9Z5buj3tg0w@mail.gmail.com>
On 11/16/2015 09:57 AM, Sathya Perla wrote:
> On Fri, Nov 13, 2015 at 3:22 PM, Ivan Vecera <ivecera@redhat.com> wrote:
>> The lancer_cmd_get_file_len() calls lancer_cmd_read_object() to get
>> the current size of registers for ethtool registers dump. The size
>> is stored in data_read but only when the returned status is 0 otherwise
>> it is uninitialized thus random.
>>
>> Signed-off-by: Ivan Vecera <ivecera@redhat.com>
>> ---
>> drivers/net/ethernet/emulex/benet/be_ethtool.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/net/ethernet/emulex/benet/be_ethtool.c b/drivers/net/ethernet/emulex/benet/be_ethtool.c
>> index f4cb8e4..26b6192 100644
>> --- a/drivers/net/ethernet/emulex/benet/be_ethtool.c
>> +++ b/drivers/net/ethernet/emulex/benet/be_ethtool.c
>> @@ -248,6 +248,8 @@ static u32 lancer_cmd_get_file_len(struct be_adapter *adapter, u8 *file_name)
>> status = lancer_cmd_read_object(adapter, &data_len_cmd, 0, 0,
>> file_name, &data_read, &eof,
>> &addn_status);
>> + if (status)
>> + return 0;
>>
>> return data_read;
>
> Ivan, unless I'm missing something...I see that "data_read" is
> initialized to 0 in this routine. So, this routine will return 0 when
> lancer_cmd_read_object() returns a non-zero status.
Yeah, you are right...my bad eyes. I was confused that status is read
but not checked... In this case 'status' var can be removed.
Ivan
prev parent reply other threads:[~2015-11-16 9:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-13 9:52 [PATCH net] be2net: check properly status in lancer_cmd_get_file_len() Ivan Vecera
2015-11-16 8:57 ` Sathya Perla
2015-11-16 9:21 ` Ivan Vecera [this message]
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=5649A015.5040701@redhat.com \
--to=ivecera@redhat.com \
--cc=ajit.khaparde@avagotech.com \
--cc=netdev@vger.kernel.org \
--cc=padmanabh.ratnakar@avagotech.com \
--cc=sathya.perla@avagotech.com \
--cc=sriharsha.basavapatna@avagotech.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.