From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753342AbbCKPnX (ORCPT ); Wed, 11 Mar 2015 11:43:23 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:44494 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751193AbbCKPnW (ORCPT ); Wed, 11 Mar 2015 11:43:22 -0400 Date: Wed, 11 Mar 2015 16:43:18 +0100 From: Greg Kroah-Hartman To: Brian Russell Cc: "Hans J. Koch" , linux-kernel@vger.kernel.org Subject: Re: [PATCH] uio: Fix uio driver to refcount device Message-ID: <20150311154318.GA1238@kroah.com> References: <55005FDE.20602@brocade.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55005FDE.20602@brocade.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 11, 2015 at 03:31:42PM +0000, Brian Russell wrote: > Protect uio driver from crashing if its owner is hot unplugged while there > are open fds. > Signed-off-by: Brian Russell Minor nit, you need a blank line before your s-o-b: line. > --- > drivers/uio/uio.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c > index 6276f13..70ce015 100644 > --- a/drivers/uio/uio.c > +++ b/drivers/uio/uio.c > @@ -434,9 +434,11 @@ static int uio_open(struct inode *inode, struct file *filep) > goto out; > } > > + get_device(idev); What is the real oops caused when a device is removed? Protecting this with a reference count seems ok, but it seems "heavy". thanks, greg k-h