From: Milan Svoboda Date: Wed, 9 Aug 2006 05:14:43 +0000 (-0700) Subject: USB gadget: gadgetfs dont try to lock before free X-Git-Tag: v2.6.19-rc1~899^2~62 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=a94da8971e836f32315f8832b0bf3e88bee9efae;p=linux-2.6-omap-h63xx.git USB gadget: gadgetfs dont try to lock before free I spotted this during my tests with -rt on arm. The -rt patch contains some better tools to diagnose problems with locks and some other things... Original code tries to take semaphore in BUG_ON and then free the memory with this semaphore. Signed-off-by: Milan Svoboda Signed-off-by: David Brownell Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c index ed9b404e5f5..a38b6af2c35 100644 --- a/drivers/usb/gadget/inode.c +++ b/drivers/usb/gadget/inode.c @@ -223,7 +223,6 @@ static void put_ep (struct ep_data *data) /* needs no more cleanup */ BUG_ON (!list_empty (&data->epfiles)); BUG_ON (waitqueue_active (&data->wait)); - BUG_ON (down_trylock (&data->lock) != 0); kfree (data); }