Re: [PATCH] i2o: add missing destroy_workqueue() on error ini2o_driver_register()

From: Andrew Morton
Date: Tue Sep 24 2013 - 19:47:10 EST


On Mon, 23 Sep 2013 17:56:56 +0800 Wei Yongjun <weiyj.lk@xxxxxxxxx> wrote:

> From: Wei Yongjun <yongjun_wei@xxxxxxxxxxxxxxxxx>
>
> Add the missing destroy_workqueue() before return from
> i2o_driver_register() in the error handling case.

yup.

> --- a/drivers/message/i2o/driver.c
> +++ b/drivers/message/i2o/driver.c
> @@ -105,7 +105,8 @@ int i2o_driver_register(struct i2o_driver *drv)
> osm_err("too many drivers registered, increase "
> "max_drivers\n");
> spin_unlock_irqrestore(&i2o_drivers_lock, flags);
> - return -EFAULT;
> + rc = -EFAULT;

Why on earth does this function return -EFAULT (twice)? Imagine the poor
user's confusion if that code gets propagated back to his application
or shell.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/