mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark D Rustad <mrustad@gmail.com>
To: Jonathan Corbet <corbet@lwn.net>
Cc: Jean Delvare <jdelvare@suse.de>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	Markus Elfring <elfring@users.sourceforge.net>
Subject: Re: [PATCH] CodingStyle: Clarify and complete chapter 7
Date: Sun, 14 Aug 2016 13:12:33 -0700	[thread overview]
Message-ID: <C5FAE00A-12A3-4AE6-97BB-794EC00549AD@gmail.com> (raw)
In-Reply-To: <20160814123024.79c2082a@lwn.net>

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

Jonathan Corbet <corbet@lwn.net> wrote:

> On Mon, 25 Jul 2016 14:29:06 +0200
> Jean Delvare <jdelvare@suse.de> wrote:
>
>> Chapter 7 (Centralized exiting of functions) of the coding style
>> documentation is unclear at times, and lacks some information (such
>> as the possibility to indent labels with a single space.) Clarify and
>> complete it.
>
> OK, I've applied this (finally) to the docs tree, sorry for sitting on it
> for so long.  One question, though...
>
>> A common type of bug to be aware of is "one err bugs" which look like  
>> this:
>>
>> -	err:
>> +	 err:
>>  		kfree(foo->bar);
>>  		kfree(foo);
>>  		return ret;
>>
>>  The bug in this code is that on some exit paths "foo" is NULL.  Normally the
>
> ...except that kfree() can handle null pointers just fine, so this isn't
> actually a bug, right?  Someday when somebody has time it would be good to
> come up with a better example.

But if foo is NULL, foo->bar is not NULL and so kfree will have a problem  
with it. So this is a bug.

--
Mark Rustad, MRustad@gmail.com

[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 841 bytes --]

  reply	other threads:[~2016-08-14 20:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-25 12:29 Jean Delvare
2016-08-14 18:30 ` Jonathan Corbet
2016-08-14 20:12   ` Mark D Rustad [this message]
2016-08-14 20:45     ` Jonathan Corbet
2016-08-15 15:38     ` SF Markus Elfring

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=C5FAE00A-12A3-4AE6-97BB-794EC00549AD@gmail.com \
    --to=mrustad@gmail.com \
    --cc=corbet@lwn.net \
    --cc=elfring@users.sourceforge.net \
    --cc=jdelvare@suse.de \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®