From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932231AbcHNSa1 (ORCPT ); Sun, 14 Aug 2016 14:30:27 -0400 Received: from tex.lwn.net ([70.33.254.29]:42661 "EHLO vena.lwn.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751631AbcHNSaZ (ORCPT ); Sun, 14 Aug 2016 14:30:25 -0400 Date: Sun, 14 Aug 2016 12:30:24 -0600 From: Jonathan Corbet To: Jean Delvare Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Markus Elfring Subject: Re: [PATCH] CodingStyle: Clarify and complete chapter 7 Message-ID: <20160814123024.79c2082a@lwn.net> In-Reply-To: <20160725142906.003bfe06@endymion> References: <20160725142906.003bfe06@endymion> Organization: LWN.net MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 25 Jul 2016 14:29:06 +0200 Jean Delvare 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. Thanks, jon