netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: xiaolou4617@gmail.com
Cc: andrew.hendry@gmail.com, nhorman@tuxdriver.com,
	linux-x25@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v2] net: x25: fix one potential use-after-free issue
Date: Tue, 16 May 2017 13:16:26 -0400 (EDT)	[thread overview]
Message-ID: <20170516.131626.1752384449655666500.davem@davemloft.net> (raw)
In-Reply-To: <1494906774-16352-1-git-send-email-xiaolou4617@gmail.com>

From: linzhang <xiaolou4617@gmail.com>
Date: Tue, 16 May 2017 11:52:54 +0800

>  	return rc;
> -out_dev:
> +out_proc:
> +	x25_unregister_sysctl();
> +out_sysctl:
>  	unregister_netdevice_notifier(&x25_dev_notifier);
> -out_sock:
> +out_dev:
> +	dev_remove_pack(&x25_packet_type);
>  	sock_unregister(AF_X25);
> -out_proto:
> +out_sock:
>  	proto_unregister(&x25_proto);
>  	goto out;
>  }

Please do not name the labels this way, retain the current convention.
And that is the label names what resources get released not the
resource that we failed to acquire.

So the first label, should be "out_sysctl:" because that is what we
are releasing.

      reply	other threads:[~2017-05-16 17:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-16  3:52 [PATCH net v2] net: x25: fix one potential use-after-free issue linzhang
2017-05-16 17:16 ` David Miller [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=20170516.131626.1752384449655666500.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=andrew.hendry@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-x25@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    --cc=xiaolou4617@gmail.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).