Re: [PATCH 1/3] ps3: vuart: fix error path locking

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

 



On Wed, 12 Dec 2007 18:00:12 -0800
Geoff Levand <[email protected]> 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 <[email protected]>
> > 
> > ---
> >  drivers/ps3/ps3-vuart.c |    1 -
> >  1 file changed, 1 deletion(-)
> 
> 
> Signed-off-by: Geoff Levand <[email protected]>
> 
> 
> 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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux