Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754631Ab0KISV4 (ORCPT ); Tue, 9 Nov 2010 13:21:56 -0500 Received: from imr4.ericy.com ([198.24.6.8]:57321 "EHLO imr4.ericy.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752991Ab0KISVw (ORCPT ); Tue, 9 Nov 2010 13:21:52 -0500 Subject: Re: [PATCH v2] hwmon: (gpio-fan) Fix fan_ctrl_init error path From: Guenter Roeck Reply-To: guenter.roeck@ericsson.com To: Axel Lin CC: linux-kernel , Jean Delvare , Simon Guinot , "lm-sensors@lm-sensors.org" In-Reply-To: <1289292108.28671.1.camel@mola> References: <1289292108.28671.1.camel@mola> Content-Type: text/plain; charset="UTF-8" Organization: Ericsson Date: Tue, 9 Nov 2010 10:20:56 -0800 Message-ID: <1289326856.22931.211.camel@groeck-laptop> MIME-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 808 Lines: 23 On Tue, 2010-11-09 at 03:41 -0500, Axel Lin wrote: > In current implementation, the sysfs entries is not removed before return -ENODEV. > > Creating the sysfs attribute should be the last thing done by the function, > after all the rest has been successful. > Otherwise there is a small window during which user-space can access the attribute > but the driver isn't ready to deal with the requests. > > Fix it by moving sysfs_create_group to be the last thing done by the function. > > Signed-off-by: Axel Lin Applied. Thanks, Guenter -- 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/