From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751944AbbCTOUW (ORCPT ); Fri, 20 Mar 2015 10:20:22 -0400 Received: from galahad.ideasonboard.com ([185.26.127.97]:49502 "EHLO galahad.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750977AbbCTOUS (ORCPT ); Fri, 20 Mar 2015 10:20:18 -0400 From: Laurent Pinchart To: Sudeep Holla Cc: Felipe Balbi , linux-usb@vger.kernel.org, Dan Carpenter , linux-kernel@vger.kernel.org Subject: Re: [PATCH] usb: isp1760: fix spin unlock in the error path of isp1760_udc_start Date: Fri, 20 Mar 2015 16:20:30 +0200 Message-ID: <14712088.dyzVQIQYao@avalon> User-Agent: KMail/4.14.3 (Linux/3.18.7-gentoo; KDE/4.14.3; x86_64; ; ) In-Reply-To: <1426851737-24999-1-git-send-email-sudeep.holla@arm.com> References: <1426851737-24999-1-git-send-email-sudeep.holla@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sudeep, Thank you for the patch. On Friday 20 March 2015 11:42:17 Sudeep Holla wrote: > Commit a124820de5fd ("usb: isp1760: fix possible deadlock in > isp1760_udc_irq") replaced spin_{un,}lock with > spin_{un,}lock_irq{save,restore}. However it missed an error path resulting > in the smatch warning as below: > > drivers/usb/isp1760/isp1760-udc.c:1230 isp1760_udc_start() warn: > inconsistent returns 'irqsave:flags'. Locked on: line 1207 > Unlocked on: line 1199 > > This patch fixes the spin unlock in the error path in isp1760_udc_start > thereby removing the smatch warning mentioned above. > > Reported-by: Dan Carpenter > Cc: Laurent Pinchart > Cc: Felipe Balbi > Signed-off-by: Sudeep Holla Acked-by: Laurent Pinchart > --- > drivers/usb/isp1760/isp1760-udc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > Hi Laurent, Felipe, > > I am extremely sorry for missing this in my original patch. I hope you will be ashamed for the 7 generations to come for this totally unacceptable low quality standard. Just kidding of course, to err is human :-) Thank you for fixing it. > Thanks to Dan Carpenter for reporting this. > > Regards, > Sudeep > > diff --git a/drivers/usb/isp1760/isp1760-udc.c > b/drivers/usb/isp1760/isp1760-udc.c index fbfbd59aae64..b7094eee0bdd 100644 > --- a/drivers/usb/isp1760/isp1760-udc.c > +++ b/drivers/usb/isp1760/isp1760-udc.c > @@ -1203,7 +1203,7 @@ static int isp1760_udc_start(struct usb_gadget > *gadget, > > if (udc->driver) { > dev_err(udc->isp->dev, "UDC already has a gadget driver\n"); > - spin_unlock(&udc->lock); > + spin_unlock_irqrestore(&udc->lock, flags); > return -EBUSY; > } -- Regards, Laurent Pinchart