Re: [patch] perf/x86/intel/pt: cleanup error handling in pt_pmu_hw_init()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Dan Carpenter <dan.carpenter@xxxxxxxxxx> wrote:

> On Thu, Apr 09, 2015 at 04:54:40PM +0200, Ingo Molnar wrote:
> > > [...]  If you unwind like:
> > > 
> > > err_free_bar:
> > > 	kfree(foo->bar);
> > > err_free_foo:
> > > 	kfree(foo);
> > > 	return ret;
> > > 
> > > That is less error prone.
> > 
> > That's how I name and structure unwind labels as well, and my 
> > suggestion is to use something similar here in this code too, in 
> > arch/x86/kernel/cpu/perf_event_intel_pt.c.
> > 
> > Agreed?
> 
> I don't understand what you want me to do here.  I think you are saying
> I should do this:
> 
> err_attrs:
> 	kfree(attrs);
> err:
> 	return ret;

Yeah, that looks cleaner.

> 
> That's not the style that the rest of this file uses. [...]

That might have slipped through review, but it's not a reason to 
continue the bad practice.

Thanks,

	Ingo
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux