netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Lebrun <david.lebrun@uclouvain.be>
To: David Miller <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>
Subject: Re: [PATCH 2/9] ipv6: sr: add code base for control plane support of SR-IPv6
Date: Mon, 17 Oct 2016 17:06:06 +0200	[thread overview]
Message-ID: <5804E8DE.20200@uclouvain.be> (raw)
In-Reply-To: <20161017.110055.762862023679772858.davem@davemloft.net>

[-- Attachment #1: Type: text/plain, Size: 1026 bytes --]

On 10/17/2016 05:00 PM, David Miller wrote:
> Please ordre local variables from longest to shortest line (AKA reverse
> christmas tree layout).
> 
> Please audit your entire submission for this problem.
> 
>> +	val = (struct in6_addr *)nla_data(info->attrs[SEG6_ATTR_DST]);
> 
> Please remove all casts from void pointers, they are completely unecessary.
> Since nla_data() returns "(void *)", this applies here.
> 
> Please audit your entire submission for this problem.
> 

Will do

>> +	mutex_init(&sdata->lock);
>> +
>> +	sdata->tun_src = kzalloc(sizeof(*sdata->tun_src), GFP_KERNEL);
>> +	if (!sdata->tun_src) {
>> +		kfree(sdata);
>> +		return -ENOMEM;
> 
> Best not to free an object while you still hold a mutex inside of it.
> 
> Also taking the mutex makes no sense at all, this object has no global
> visibility, therefore no other thread of control can operate upon it.
> 

The mutex is not taken, just initialized. Unless mutex_init takes the
lock, which would be quite strange ?


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

  reply	other threads:[~2016-10-17 15:04 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-17 14:42 [PATCH 0/9] net: add support for IPv6 Segment Routing David Lebrun
2016-10-17 14:42 ` [PATCH 1/9] ipv6: implement dataplane support for rthdr type 4 (Segment Routing Header) David Lebrun
2016-10-17 14:57   ` David Miller
2016-10-17 15:04     ` David Lebrun
2016-10-17 17:01   ` Tom Herbert
2016-10-18 11:43     ` David Lebrun
2016-10-20 13:04     ` David Lebrun
2016-10-20 15:47       ` Tom Herbert
2016-10-17 17:31   ` Tom Herbert
2016-10-17 14:42 ` [PATCH 2/9] ipv6: sr: add code base for control plane support of SR-IPv6 David Lebrun
2016-10-17 15:00   ` David Miller
2016-10-17 15:06     ` David Lebrun [this message]
2016-10-17 15:21       ` David Miller
2016-10-17 17:07   ` Tom Herbert
2016-10-18 11:45     ` David Lebrun
2016-10-17 14:42 ` [PATCH 3/9] ipv6: sr: add support for SRH encapsulation and injection with lwtunnels David Lebrun
2016-10-17 17:17   ` Tom Herbert
2016-10-18 11:47     ` David Lebrun
2016-10-17 14:42 ` [PATCH 4/9] ipv6: sr: add core files for SR HMAC support David Lebrun
2016-10-17 17:24   ` Tom Herbert
2016-10-18 12:07     ` David Lebrun
2016-10-19 13:20   ` zhuyj
2016-10-19 14:43     ` David Laight
2016-10-17 14:43 ` [PATCH 5/9] ipv6: sr: implement API to control SR HMAC structures David Lebrun
2016-10-17 14:43 ` [PATCH 6/9] ipv6: sr: add calls to verify and insert HMAC signatures David Lebrun
2016-10-17 14:43 ` [PATCH 7/9] ipv6: add source address argument for ipv6_push_nfrag_opts David Lebrun
2016-10-17 14:43 ` [PATCH 8/9] ipv6: sr: add support for SRH injection through setsockopt David Lebrun
2016-10-17 14:43 ` [PATCH 9/9] ipv6: sr: add documentation file for per-interface sysctls David Lebrun
2016-10-17 15:09 ` [PATCH 0/9] net: add support for IPv6 Segment Routing David Laight

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=5804E8DE.20200@uclouvain.be \
    --to=david.lebrun@uclouvain.be \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.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 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).