Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934547AbZLKX3v (ORCPT ); Fri, 11 Dec 2009 18:29:51 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S934464AbZLKX3d (ORCPT ); Fri, 11 Dec 2009 18:29:33 -0500 Received: from kroah.org ([198.145.64.141]:50464 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933876AbZLKX3B (ORCPT ); Fri, 11 Dec 2009 18:29:01 -0500 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Alan Cox , Alan Stern , Oliver Neukum , Greg Kroah-Hartman Subject: [PATCH 17/58] opticon: Fix resume logic Date: Fri, 11 Dec 2009 15:28:01 -0800 Message-Id: <1260574122-10676-17-git-send-email-gregkh@suse.de> X-Mailer: git-send-email 1.6.5.3 In-Reply-To: <20091211232805.GA10652@kroah.com> References: <20091211232805.GA10652@kroah.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1227 Lines: 35 From: Alan Cox Opticon now takes the right mutex to check the port status but the status check is done wrongly for the modern serial code, so fix it. Signed-off-by: Alan Cox Cc: Alan Stern Cc: Oliver Neukum Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/opticon.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/usb/serial/opticon.c b/drivers/usb/serial/opticon.c index c03fdc0..4cdb975 100644 --- a/drivers/usb/serial/opticon.c +++ b/drivers/usb/serial/opticon.c @@ -502,7 +502,8 @@ static int opticon_resume(struct usb_interface *intf) int result; mutex_lock(&port->port.mutex); - if (port->port.count) + /* This is protected by the port mutex against close/open */ + if (test_bit(ASYNCB_INITIALIZED, &port->port.flags)) result = usb_submit_urb(priv->bulk_read_urb, GFP_NOIO); else result = 0; -- 1.6.5.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/