From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754459AbcHVF0z (ORCPT ); Mon, 22 Aug 2016 01:26:55 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:56686 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754278AbcHVF0q (ORCPT ); Mon, 22 Aug 2016 01:26:46 -0400 X-IBM-Helo: d06dlp01.portsmouth.uk.ibm.com X-IBM-MailFrom: rppt@linux.vnet.ibm.com X-IBM-RcptTo: kernel-janitors@vger.kernel.org;linux-kernel@vger.kernel.org;netdev@vger.kernel.org Date: Mon, 22 Aug 2016 08:26:36 +0300 From: Mike Rapoport To: "Michael S. Tsirkin" Cc: SF Markus Elfring , netdev@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jason Wang , Paolo Abeni , Soheil Hassas Yeganeh , LKML , kernel-janitors@vger.kernel.org, Julia Lawall Subject: Re: [PATCH 2/2] tun: Rename a jump label in update_filter() References: <566ABCD9.1060404@users.sourceforge.net> <9cf06275-924d-6c22-d8a8-f733a03cca23@users.sourceforge.net> <0c8d93e2-34cf-ca23-955e-999f424b3ab2@users.sourceforge.net> <20160822044048-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160822044048-mutt-send-email-mst@kernel.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16082205-0008-0000-0000-000002B577F2 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16082205-0009-0000-0000-00001985A654 Message-Id: <20160822052635.GC1205@rapoport-lnx> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-08-22_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=2 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1608220059 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 22, 2016 at 04:41:11AM +0300, Michael S. Tsirkin wrote: > On Sat, Aug 20, 2016 at 09:37:16AM +0200, SF Markus Elfring wrote: > > From: Markus Elfring > > Date: Sat, 20 Aug 2016 09:00:34 +0200 > > > > Adjust a jump target according to the Linux coding style convention. > > > > Signed-off-by: Markus Elfring > > I don't have an opinion of this one. Which convention do you refer to? Citing Documentation/CodingStyle: Choose label names which say what the goto does or why the goto exists. An example of a good name could be "out_buffer:" if the goto frees "buffer". Avoid using GW-BASIC names like "err1:" and "err2:". Also don't name them after the goto location like "err_kmalloc_failed:" > > > --- > > drivers/net/tun.c | 5 ++--- > > 1 file changed, 2 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/net/tun.c b/drivers/net/tun.c > > index a1aeccb..e249428 100644 > > --- a/drivers/net/tun.c > > +++ b/drivers/net/tun.c > > @@ -753,7 +753,7 @@ static int update_filter(struct tap_filter *filter, void __user *arg) > > for (; n < uf.count; n++) { > > if (!is_multicast_ether_addr(addr[n].u)) { > > err = 0; /* no filter */ > > - goto done; > > + goto free_addr; > > } > > addr_hash_set(filter->mask, addr[n].u); > > } > > @@ -769,8 +769,7 @@ static int update_filter(struct tap_filter *filter, void __user *arg) > > > > /* Return the number of exact filters */ > > err = nexact; > > - > > -done: > > +free_addr: > > kfree(addr); > > return err; > > } > > -- > > 2.9.3 >