public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation•org>
To: Geoff Levand <geoffrey.levand@am•sony.com>
Cc: dwalker@mvista•com, matthias.kaehlcke@gmail•com,
	linux-kernel@vger•kernel.org, linux@bohmer•net,
	linuxppc-dev@ozlabs•org, mingo@elte•hu, kjwinchester@gmail•com
Subject: Re: [PATCH 1/3] ps3: vuart: fix error path locking
Date: Tue, 18 Dec 2007 17:10:50 -0800	[thread overview]
Message-ID: <20071218171050.5bf220fa.akpm@linux-foundation.org> (raw)
In-Reply-To: <4760922C.2060908@am.sony.com>

On Wed, 12 Dec 2007 18:00:12 -0800
Geoff Levand <geoffrey.levand@am•sony.com> wrote:

> > This stray down would cause a permanent sleep which doesn't seem correct. 
> > The other uses of this semaphore appear fairly mutex like it's even initialized
> > with init_MUTEX() ..  So here a patch for removing this one down().
> > 
> > Signed-off-by: Daniel Walker <dwalker@mvista•com>
> > 
> > ---
> >  drivers/ps3/ps3-vuart.c |    1 -
> >  1 file changed, 1 deletion(-)
> 
> 
> Signed-off-by: Geoff Levand <geoffrey.levand@am•sony.com>
> 
> 
> Looks, good. 

Looks bad to me.

> Andrew, Please apply.

The current code:

	if (result) {
		dev_dbg(&dev->core, "%s:%d: drv->probe failed\n",
			__func__, __LINE__);
		down(&vuart_bus_priv.probe_mutex);
		goto fail_probe;
	}

	up(&vuart_bus_priv.probe_mutex);

	return result;

fail_probe:
	ps3_vuart_set_interrupt_mask(dev, 0);
	kfree(dev->driver_priv);
	dev->driver_priv = NULL;
fail_dev_malloc:
	vuart_bus_priv.devices[dev->port_number] = NULL;
fail_busy:
	ps3_vuart_bus_interrupt_put();
fail_setup_interrupt:
	up(&vuart_bus_priv.probe_mutex);
	dev_dbg(&dev->core, "%s:%d: failed\n", __func__, __LINE__);
	return result;
}

is correct.  Although not exactly a thing of beauty.

  reply	other threads:[~2007-12-19  1:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20071213003023.117964080@mvista.com>
2007-12-12  8:00 ` [PATCH 1/3] ps3: vuart: fix error path locking Daniel Walker
2007-12-13  2:00   ` Geoff Levand
2007-12-19  1:10     ` Andrew Morton [this message]
2007-12-19  1:54       ` Daniel Walker
2007-12-19  3:04       ` Geoff Levand
2007-12-20 19:32         ` Daniel Walker
2007-12-20 20:06           ` Andrew Morton
2007-12-20 20:13             ` Daniel Walker

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=20071218171050.5bf220fa.akpm@linux-foundation.org \
    --to=akpm@linux-foundation$(echo .)org \
    --cc=dwalker@mvista$(echo .)com \
    --cc=geoffrey.levand@am$(echo .)sony.com \
    --cc=kjwinchester@gmail$(echo .)com \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux@bohmer$(echo .)net \
    --cc=linuxppc-dev@ozlabs$(echo .)org \
    --cc=matthias.kaehlcke@gmail$(echo .)com \
    --cc=mingo@elte$(echo .)hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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