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=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 34332C43603 for ; Thu, 19 Dec 2019 19:11:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F30CF24679 for ; Thu, 19 Dec 2019 19:11:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576782685; bh=1X556cXYPxEAIMO19u1jJy89/RHUKO0B66A4saMjNRo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=fRhteJWBJoij4sxjQEFSn9sRcScLf/8Vh1Jr9kChCpW1tMOzwcaFKitrxFbCntdIs 3lvOjJCflr8azG5fPvAxVqw0mCIu6oF99NXRxbLBNx4Y7MSHePi4EyudeOiF2j9EiM 1S45yky28I43u/jC8YIibFXUIb09bwaXCrJwZmq0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727698AbfLSSiW (ORCPT ); Thu, 19 Dec 2019 13:38:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:56328 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728008AbfLSSiU (ORCPT ); Thu, 19 Dec 2019 13:38:20 -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 DF20F24683; Thu, 19 Dec 2019 18:38:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576780700; bh=1X556cXYPxEAIMO19u1jJy89/RHUKO0B66A4saMjNRo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ogwpIwLzw2hamHuzT5YBoaL8QS3ROmjt45fnYT6Q6vgsNljsJvkZmzW6zACr34QPm gP9C4f3rxydvO1VsA1bZjT9ACvgJbRgpO6wz+DY3EZXy3JuW3CE05/u7TncnZhkI1W b3+wo86j13mdaRFgdiO3VpA1ATpIUyZq2hAexN6I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wei Yongjun , Peter Chen Subject: [PATCH 4.4 082/162] usb: gadget: configfs: Fix missing spin_lock_init() Date: Thu, 19 Dec 2019 19:33:10 +0100 Message-Id: <20191219183212.791700716@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191219183150.477687052@linuxfoundation.org> References: <20191219183150.477687052@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Wei Yongjun commit 093edc2baad2c258b1f55d1ab9c63c2b5ae67e42 upstream. 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 Cc: stable Reviewed-by: Peter Chen Link: https://lore.kernel.org/r/20191030034046.188808-1-weiyongjun1@huawei.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/configfs.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/usb/gadget/configfs.c +++ b/drivers/usb/gadget/configfs.c @@ -1542,6 +1542,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);