From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932311AbcGFPhI (ORCPT ); Wed, 6 Jul 2016 11:37:08 -0400 Received: from mail-pa0-f52.google.com ([209.85.220.52]:35651 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932235AbcGFPhF (ORCPT ); Wed, 6 Jul 2016 11:37:05 -0400 Date: Wed, 6 Jul 2016 08:37:03 -0700 From: Viresh Kumar To: Peter Rosin Cc: Lars-Peter Clausen , Wolfram Sang , Jean Delvare , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, Johan Hovold , Alex Elder Subject: Re: [PATCH 2/2] i2c-dev: Don't block the adapter from unregistering Message-ID: <20160706153703.GN2671@ubuntu> References: <021486be2f5425ce2379219a7ac163ee14ba2aba.1467772840.git.viresh.kumar@linaro.org> <415dcaa7-8ad9-492e-5c5c-605173bc4345@axentia.se> <20160706143323.GK2671@ubuntu> <577D1907.20002@metafoo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06-07-16, 17:04, Peter Rosin wrote: > Exactly, so the stored address had better be correct, and in No. > that case there is no need for the new adapter_nr in every > client, you could just go with client->adapter->nr instead. client->adapter may be a dangling pointer at this point if the adapter is freed, so we can't use that blindly for sure. > Which just shows that the whole thing is fishy and that the > adapter has to remain alive. BTW, is there any guarantee that > adapter numbers will not get reused? We are allocating them from idr and that will reuse them once they get freed. -- viresh