From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1034858AbcKAO4c (ORCPT ); Tue, 1 Nov 2016 10:56:32 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:44530 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1034090AbcKAO4b (ORCPT ); Tue, 1 Nov 2016 10:56:31 -0400 Date: Tue, 1 Nov 2016 08:56:38 -0600 From: Greg KH To: Songjun Wu Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] kobject: set state_initialized to 0 in kobject_cleanup Message-ID: <20161101145638.GA1474@kroah.com> References: <1477996905-16920-1-git-send-email-songjun.wu@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1477996905-16920-1-git-send-email-songjun.wu@microchip.com> User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. thanks, greg k-h