public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches•com>
To: Pavel Belous <Pavel.Belous@aquantia•com>,
	"David S . Miller" <davem@davemloft•net>
Cc: netdev@vger•kernel.org, David Arcari <darcari@redhat•com>,
	Lino Sanfilippo <LinoSanfilippo@gmx•de>,
	Simon Edelhaus <simon.edelhaus@aquantia•com>
Subject: Re: [PATCH] aquantia: Fix "ethtool -S" crash when adapter down.
Date: Thu, 04 May 2017 13:30:03 -0700	[thread overview]
Message-ID: <1493929803.31950.3.camel@perches.com> (raw)
In-Reply-To: <9ea5a2ba21b4f8b22a63acf39135a41e2f1da23c.1493928470.git.pavel.belous@aquantia.com>

On Thu, 2017-05-04 at 23:10 +0300, Pavel Belous wrote:
> diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
[]
> @@ -959,8 +959,10 @@ void aq_nic_free_hot_resources(struct aq_nic_s *self)
>  		goto err_exit;
>  
>  	for (i = AQ_DIMOF(self->aq_vec); i--;) {
> -		if (self->aq_vec[i])
> +		if (self->aq_vec[i]) {
>  			aq_vec_free(self->aq_vec[i]);
> +			self->aq_vec[i] = NULL;
> +		}
>  	}
>  
>  err_exit:;

unrelated style trivia:

err_exit:;

the error label then :; is pretty odd.

Also casting the return value to void is really odd.
A simple return instead of goto would be more common.

drivers/net/ethernet/aquantia/atlantic/aq_ring.c:311:err_exit:;
drivers/net/ethernet/aquantia/atlantic/aq_ring.c:326:err_exit:;
drivers/net/ethernet/aquantia/atlantic/aq_main.c:161:err_exit:;
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c:277:err_exit:;
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c:313:err_exit:;
drivers/net/ethernet/aquantia/atlantic/aq_nic.c:304:err_exit:;
drivers/net/ethernet/aquantia/atlantic/aq_nic.c:763:err_exit:;
drivers/net/ethernet/aquantia/atlantic/aq_nic.c:951:err_exit:;
drivers/net/ethernet/aquantia/atlantic/aq_nic.c:966:err_exit:;
drivers/net/ethernet/aquantia/atlantic/aq_vec.c:281:err_exit:;
drivers/net/ethernet/aquantia/atlantic/aq_vec.c:302:err_exit:;
drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c:251:err_exit:;
drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c:270:err_exit:;

  reply	other threads:[~2017-05-04 20:30 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-04 20:10 [PATCH] aquantia: Fix "ethtool -S" crash when adapter down Pavel Belous
2017-05-04 20:30 ` Joe Perches [this message]
2017-05-04 20:39 ` David Arcari
2017-05-08 16:53 ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2017-05-04 16:33 Pavel Belous
2017-05-04 16:48 ` Lino Sanfilippo
2017-05-04 16:51   ` David Miller
2017-05-04 17:09     ` Pavel Belous
2017-05-04 18:27       ` David Arcari
2017-05-04 18:37         ` Pavel Belous
2017-05-04 19:08           ` Lino Sanfilippo
2017-05-04 17:00 ` David Arcari
2017-05-04 17:08   ` Pavel Belous
2017-05-04 18:17     ` Joe Perches
2017-05-04 18:41       ` Pavel Belous

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=1493929803.31950.3.camel@perches.com \
    --to=joe@perches$(echo .)com \
    --cc=LinoSanfilippo@gmx$(echo .)de \
    --cc=Pavel.Belous@aquantia$(echo .)com \
    --cc=darcari@redhat$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=simon.edelhaus@aquantia$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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