Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754712Ab3IXXqt (ORCPT ); Tue, 24 Sep 2013 19:46:49 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:38193 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754169Ab3IXXqs (ORCPT ); Tue, 24 Sep 2013 19:46:48 -0400 Date: Tue, 24 Sep 2013 16:46:46 -0700 From: Andrew Morton To: Wei Yongjun Cc: keescook@chromium.org, yongjun_wei@trendmicro.com.cn, linux-kernel@vger.kernel.org Subject: Re: [PATCH] i2o: add missing destroy_workqueue() on error in i2o_driver_register() Message-Id: <20130924164646.c42172bb0f86e5eec0c16fe5@linux-foundation.org> In-Reply-To: References: X-Mailer: Sylpheed 3.2.0beta5 (GTK+ 2.24.10; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 970 Lines: 27 On Mon, 23 Sep 2013 17:56:56 +0800 Wei Yongjun wrote: > From: Wei Yongjun > > 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/