From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33E33C432C0 for ; Wed, 20 Nov 2019 19:47:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 09E722088F for ; Wed, 20 Nov 2019 19:47:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574279234; bh=TzLV4YRhBI1Y8XGqiMff3E5PU+5yB3PhvAPoW8EqbA8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=Ufq5cplOe3Dd6wohjHSuhot82Lq2SzqX72Ql7VC9XauI1+UKSKQSqrGSkEYleCeRW scV6ZrAbBc0wW6dYRTioupomG6dpalwYgGq2lomwA4hv5XVIERvtcb6BNqBjdLP5R1 8X1gBSYI8gNuRgSgvVOmqMJvDGfQ1DbdY78/BwPQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727800AbfKTTrN (ORCPT ); Wed, 20 Nov 2019 14:47:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:36426 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727378AbfKTTrM (ORCPT ); Wed, 20 Nov 2019 14:47:12 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 760AA20679; Wed, 20 Nov 2019 19:47:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574279232; bh=TzLV4YRhBI1Y8XGqiMff3E5PU+5yB3PhvAPoW8EqbA8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CjKyqllJtYcxJ15lmX7PN58w2H1GP0hRMOLcRA3QNnKTQnF76ZRooNTOkyJ14Vk3j f8Tyrzp9Eu/a09IaYcbg8tQxoNqOC9ICQb9SgGJyChNQyJ3lEiaETZA4WjEeIupcG4 NKoa4aKasxYn2dRkKvsrT6GxVEUYmV/C+nVTHldM= Date: Wed, 20 Nov 2019 20:47:09 +0100 From: Greg Kroah-Hartman To: Peter Chen Cc: Peter Chen , Felipe Balbi , Wei Yongjun , "linux-usb@vger.kernel.org" , "kernel-janitors@vger.kernel.org" Subject: Re: [PATCH -next] usb: gadget: configfs: Fix missing spin_lock_init() Message-ID: <20191120194709.GA3092233@kroah.com> References: <20191030034046.188808-1-weiyongjun1@huawei.com> <20191030081101.GF26815@b29397-desktop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org On Mon, Nov 18, 2019 at 05:09:39PM +0800, Peter Chen wrote: > BR, > Peter Chen > > On Wed, Oct 30, 2019 at 4:12 PM Peter Chen wrote: > > > > On 19-10-30 03:40:46, Wei Yongjun wrote: > > > The driver allocates the spinlock but not initialize it. > > > Use spin_lock_init() on it to initialize it correctly. > > > > > > This is detected by Coccinelle semantic patch. > > > > > > Fixes: 1a1c851bbd70 ("usb: gadget: configfs: fix concurrent issue between composite APIs") > > > Signed-off-by: Wei Yongjun > > > --- > > > drivers/usb/gadget/configfs.c | 1 + > > > 1 file changed, 1 insertion(+) > > > > > > diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c > > > index 33852c2b29d1..ab9ac48a751a 100644 > > > --- a/drivers/usb/gadget/configfs.c > > > +++ b/drivers/usb/gadget/configfs.c > > > @@ -1544,6 +1544,7 @@ static struct config_group *gadgets_make( > > > gi->composite.resume = NULL; > > > gi->composite.max_speed = USB_SPEED_SUPER; > > > > > > + spin_lock_init(&gi->spinlock); > > > mutex_init(&gi->lock); > > > INIT_LIST_HEAD(&gi->string_list); > > > INIT_LIST_HEAD(&gi->available_func); > > > > > > > Reviewed-by: Peter Chen > > Hi Felipe & Greg, > > We may need this patch for usb/next and usb/linus tree, otherwise, there will > be kernel dump if enable lockdep: Ok, now queued up. thanks, greg k-h