All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Falcon <tlfalcon@linux.ibm.com>
To: Saeed Mahameed <saeed@kernel.org>, netdev@vger.kernel.org
Subject: Re: [PATCH net] ibmvnic: Fix returning uninitialized return code
Date: Thu, 17 Sep 2020 15:32:15 -0500	[thread overview]
Message-ID: <f49f90d6-3ecb-babc-a37d-0ad8ed2f4cff@linux.ibm.com> (raw)
In-Reply-To: <0a335b1f7532fb6bd3d8e685a52d691760b1e226.camel@kernel.org>


On 9/17/20 1:07 AM, Saeed Mahameed wrote:
> On Wed, 2020-09-16 at 17:12 -0500, Thomas Falcon wrote:
>> If successful, __ibmvnic_open and reset_sub_crq_queues,
>> if no device queues exist, will return an uninitialized
>> variable rc. Return zero on success instead.
>>
>> Fixes: 57a49436f4e8 ("ibmvnic: Reset sub-crqs during driver reset")
>> Fixes: ed651a10875f ("ibmvnic: Updated reset handling")
>> Signed-off-by: Thomas Falcon <tlfalcon@linux.ibm.com>
>> ---
>>   drivers/net/ethernet/ibm/ibmvnic.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/ibm/ibmvnic.c
>> b/drivers/net/ethernet/ibm/ibmvnic.c
>> index 1b702a4..1619311 100644
>> --- a/drivers/net/ethernet/ibm/ibmvnic.c
>> +++ b/drivers/net/ethernet/ibm/ibmvnic.c
>> @@ -1178,7 +1178,7 @@ static int __ibmvnic_open(struct net_device
>> *netdev)
>>   	}
>>   
>>   	adapter->state = VNIC_OPEN;
>> -	return rc;
>> +	return 0;
> rc here is unconditionally assigned a couple of lines earlier,
> but anyway i don't mind this change as it explicitly states that this
> is a success path.
>
> But maybe you want to split the patch and send this hunk to net-next.
> I don't mind, up to you.

Thanks for catching that, I'll send a v2 with just the second hunk.

Tom

>
>>   }
>>   
>>   static int ibmvnic_open(struct net_device *netdev)
>> @@ -2862,7 +2862,7 @@ static int reset_sub_crq_queues(struct
>> ibmvnic_adapter *adapter)
>>   			return rc;
>>   	}
>>   
>> -	return rc;
>> +	return 0;
> This one though is fine,
>
> Reviewed-by: Saeed Mahameed <saeedm@nvidia.com>
>
>

      reply	other threads:[~2020-09-17 21:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-16 22:12 [PATCH net] ibmvnic: Fix returning uninitialized return code Thomas Falcon
2020-09-17  6:07 ` Saeed Mahameed
2020-09-17 20:32   ` Thomas Falcon [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=f49f90d6-3ecb-babc-a37d-0ad8ed2f4cff@linux.ibm.com \
    --to=tlfalcon@linux.ibm.com \
    --cc=netdev@vger.kernel.org \
    --cc=saeed@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 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.