Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2265392ybl; Thu, 19 Dec 2019 10:40:42 -0800 (PST) X-Google-Smtp-Source: APXvYqzt17h7e7Z8OWiBSely+yDKCMzeOi1t1BFAVTCzGBNkOnfBUx2mTVhxynKNCuI3RuufuIGe X-Received: by 2002:a9d:6f8f:: with SMTP id h15mr9805364otq.1.1576780842856; Thu, 19 Dec 2019 10:40:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576780842; cv=none; d=google.com; s=arc-20160816; b=BhbwuyazIJqpqSkIyQEXA2a1CeJ0D1W+nrghP4P5j96/ivWcUcjAj37zN9zhp1o9mx bCLWlhfkXEALxT2SPrtZWHV2gYzbGu6ZZcK9nh2zlKE3L3ShjgIbKO9WuILrRjDNQfUW wQeOJRp+gGSzsKT/HHUyV8vsk9nlg+zEEoCpCSluDs92s+adQtdV3vTIFMQfnBqz3zYd NN2JMZxHDsj0ThkejVJPI+kZvTVbaCP6mMxfWxRb74t8TXnfB5nSxVYIDYUikbrq0Kc0 mIu0IlMwmr5O0pj11RWdX5r3AlGYsQr9qPNDTqpS+50GHdVHFcIf4GIT2gxVdMCEZQbc /AXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=I+ECyYvWtkY9Jn6tRYd0UoT8NgxdYC8lwrGRN1xLzys=; b=qPlB4qpqmWlr3O8Lx03XKYQ1MK6pJ6xJDULR3y0+cHM6xKztnWZ76q3E4w6UH6pKbv xGcBApTukjsbLOP5+iSEnm+w5SetWuyJzOZdMA/mZEciEmhf9yUldSFFu3SNF/Nj5P9j U3jjWyDxGn+bgNbNlc+LkLkYFqkemPKu101Z8BS2qqMex0rxhhe+218spCayq02DYT21 DJmTK5KM4Iu249NmMRUJon3iTdZWAFNiGiEEw2lXWc5dGOquSioch4V3J1LUjc05fIal F2r0AZ+1yNZScncSPiACTCyEzixBzabiT49P5EMuLzvFU8aBWFHSXtywCMZ/Uz4y8q0L o+uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ogwpIwLz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f22si1303835otp.178.2019.12.19.10.40.31; Thu, 19 Dec 2019 10:40:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ogwpIwLz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728016AbfLSSiX (ORCPT + 99 others); Thu, 19 Dec 2019 13:38:23 -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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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);