From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932224AbbCCWUO (ORCPT ); Tue, 3 Mar 2015 17:20:14 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:54588 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757093AbbCCWUL (ORCPT ); Tue, 3 Mar 2015 17:20:11 -0500 Date: Tue, 3 Mar 2015 22:20:08 +0000 From: Al Viro To: Alan Stern Cc: Alexander Holler , Richard Weinberger , USB list , LKML , Felipe Balbi Subject: Re: gadgetfs broken since 7f7f25e8 Message-ID: <20150303222007.GT29656@ZenIV.linux.org.uk> References: <20150303083934.GR29656@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 03, 2015 at 10:47:14AM -0500, Alan Stern wrote: > @@ -1279,6 +1284,9 @@ ep0_poll (struct file *fd, poll_table *w > struct dev_data *dev = fd->private_data; > int mask = 0; > > + if (dev->state <= STATE_DEV_OPENED) > + return -ENODEV; > + > poll_wait(fd, &dev->wait, wait); > > spin_lock_irq (&dev->lock); That, BTW, is wrong. ->poll() does *not* return negatives - to imitate "we don't have ->poll()" we need it to return DEFAULT_POLLMASK.