From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932503AbcKBB3h (ORCPT ); Tue, 1 Nov 2016 21:29:37 -0400 Received: from smtpout.microchip.com ([198.175.253.82]:42827 "EHLO email.microchip.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752227AbcKBB3g (ORCPT ); Tue, 1 Nov 2016 21:29:36 -0400 Subject: Re: [PATCH] kobject: set state_initialized to 0 in kobject_cleanup To: Greg KH References: <1477996905-16920-1-git-send-email-songjun.wu@microchip.com> <20161101145638.GA1474@kroah.com> CC: From: "Wu, Songjun" Organization: Microchip Message-ID: <9b6ce344-a8a8-6a51-7577-51a89005c065@microchip.com> Date: Wed, 2 Nov 2016 09:29:06 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20161101145638.GA1474@kroah.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/1/2016 22:56, Greg KH wrote: > On Tue, Nov 01, 2016 at 06:41:44PM +0800, Songjun Wu wrote: >> If state_initialized is not set to 0 when a kobject is >> released, a device is registered, unregistered, and >> registered again, the error below will occur. >> >> kobject (dec04bb0): tried to init an initialized object, >> something is seriously wrong. > > Yes, your code is wrong, don't try to change the kernel core to work > around it :) > > That message is there for a reason, and this patch has been rejected > many times in the past. kobjects can NOT ever be reused, and should > never be static (but yes, there are lots of in-kernel users with static > kobjects, they just never get reused...) > > What code is emitting this message? I'll be glad to help you fix it up > if you can point me at it. > Thank you very much. I will not use the static kobjects to fix the error. :) > thanks, > > greg k-h >