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: MMI-PSA29.97-13-9~47266^2~62 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a94da8971e836f32315f8832b0bf3e88bee9efae;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.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 ed9b404e5f5a..a38b6af2c358 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); }