All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: kernel-janitors@vger.kernel.org
Subject: Re: [patch v2] usb: gadget: f_midi: missing unlock on error path
Date: Tue, 05 Jan 2016 21:21:57 +0000	[thread overview]
Message-ID: <alpine.DEB.2.02.1601052220430.2342@localhost6.localdomain6> (raw)
In-Reply-To: <20160105102809.GA26420@mwanda>



On Tue, 5 Jan 2016, Felipe Ferreri Tonello wrote:

> Hi Dan,
> 
> On 05/01/16 12:44, Dan Carpenter wrote:
> > On Tue, Jan 05, 2016 at 01:28:11PM +0100, Julia Lawall wrote:
> >>
> >>
> >> On Tue, 5 Jan 2016, kbuild test robot wrote:
> >>
> >>> Hi Dan,
> >>>
> >>> [auto build test WARNING on balbi-usb/next]
> >>> [also build test WARNING on v4.4-rc8 next-20160105]
> >>> [if your patch is applied to the wrong git tree, please drop us a note to help improving the system]
> >>>
> >>> url:    https://github.com/0day-ci/linux/commits/Dan-Carpenter/usb-gadget-f_midi-missing-unlock-on-error-path/20160105-183115
> >>> base:   https://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git next
> >>>
> >>>
> >>> coccinelle warnings: (new ones prefixed by >>)
> >>>
> >>>>> drivers/usb/gadget/function/f_midi.c:1233:14-21: ERROR: midi is NULL but dereferenced.
> >>
> >> It's a false positive for coccinelle, but I wonder if avoiding duplicating
> >> the mutex_lock is really worth it?
> > 
> > It's not the most beautiful code in the world.  I considered a bunch of
> > different ways to write it...  This is what Felipe Tonello wanted,
> > though.
> 
> This case is not a matter of been pretty but a matter of been less error
> prone.
> 
> What would you suggest?

I thought to be a little less subtle about midi, it would be easier to 
keep the first few mutex_unlocks up where they were.  But up to you.

julia

  parent reply	other threads:[~2016-01-05 21:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-05 10:28 [patch v2] usb: gadget: f_midi: missing unlock on error path Dan Carpenter
2016-01-05 11:53 ` kbuild test robot
2016-01-05 12:28 ` Julia Lawall
2016-01-05 12:37 ` Dan Carpenter
2016-01-05 12:44 ` Dan Carpenter
2016-01-05 13:55 ` Michal Nazarewicz
2016-01-05 14:03 ` Dan Carpenter
2016-01-05 20:51 ` Felipe Ferreri Tonello
2016-01-05 21:21 ` Julia Lawall [this message]
2016-01-05 22:08 ` Dan Carpenter
2016-01-06  0:02 ` Michal Nazarewicz

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=alpine.DEB.2.02.1601052220430.2342@localhost6.localdomain6 \
    --to=julia.lawall@lip6.fr \
    --cc=kernel-janitors@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.