From patchwork Wed Oct 19 08:25:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 5526 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp337339wrs; Wed, 19 Oct 2022 06:49:02 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6XbjxzYNiGKJIDLNJwvRj75awV8syukvb2r6yNPiQdoy4vUetOcGb1cG5/36lKWm0zTHvL X-Received: by 2002:a17:902:ce0d:b0:178:bd1e:e8da with SMTP id k13-20020a170902ce0d00b00178bd1ee8damr8509158plg.103.1666187342143; Wed, 19 Oct 2022 06:49:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666187342; cv=none; d=google.com; s=arc-20160816; b=Ux75is+EuBhB8Q1S0R2/0scs8qi/rohcdWCOeWTOSDO0cvVRJOCgCAwVqKd8GkSiSc ra8QCJDnLfMNfd/DgxVfAJah/SbJeafqDF3oayImSq3y9HbM9A1isEi+n+ehdyyjPsVC fwI6jsnM7Y6bT4L3uCCbaT5WTyKUTg5Q+Be612HvHQIP2JyxAS48FtfJvzJCQ6wICST0 +AcFckxf6baIF1IV0/3ZHvtBDxjneeSi7PaxNMUSjvRotu0ltLKX9Agt0mCu2zQ7Oeam lBPBuiA1gScnEBHJ0cmfzsImcZhZXN+tOOBUnjjxHcHGcBTESjNT9dvBQbnQc+WQbLhL Apmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qsY+PlN+INru3sODjU8AcjnXAP2aCl71b/S2vrXuI1w=; b=KCeJRNwAnU61+MUPlu6H48G61ciPbDWunTo2LG8DMxd4mN9mv6OV90sQ9cmNVlyzMV pjTp46XRe7TuqO72Aguck2egUHy0kiQ1D91BI5wRcjKAj6tjIZVIVFhzXNI9YfMOsjoc ojGmU24hSZ4hZurhU1ir3/6oTGB/q5myPMKyChBVavRTLM4K/PzA5IP1KJFr/dx8Jam8 gCENekGlMqbDVvy70B7L0ZFgWGptAFi+UG5o9xdmm021HcxLVM/+mb+2TRgets8oxgaO 3/ocXAAJF0u61Y+n/mAmMXL1AdLF0m5K+cBDbjL5WBUXKfOMpB41CVmOYzmWjM9nUvo0 XPfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RTv9l4x1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z11-20020a056a001d8b00b0054568a55597si16468243pfw.96.2022.10.19.06.48.49; Wed, 19 Oct 2022 06:49:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RTv9l4x1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233485AbiJSNs1 (ORCPT + 99 others); Wed, 19 Oct 2022 09:48:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233204AbiJSNq6 (ORCPT ); Wed, 19 Oct 2022 09:46:58 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 553C450514; Wed, 19 Oct 2022 06:32:24 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 84E4DCE2100; Wed, 19 Oct 2022 08:50:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 83368C433D6; Wed, 19 Oct 2022 08:50:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169415; bh=oyGyxWJUXiy5R6FcVcV6T7cfpWGfVqEQbstwhBlVSqA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RTv9l4x126g/Q0yfxj8jONoZe4S3tFs2/qwehXhZx0RpaEs0f9PTxsgI56szSbaPo aosxKolWjsF9uI+xL7+4D5MxXzNmNw+QIUm1xUdOHiKQ1h5EL5BMbW1CKCqg0po750 eCsrHbIfvzCPLmOnmBhAqa5gdWuVhceKf2LApmCg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pavel Machek , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Wolfram Sang , Sasha Levin Subject: [PATCH 6.0 234/862] leds: lm3601x: Dont use mutex after it was destroyed Date: Wed, 19 Oct 2022 10:25:21 +0200 Message-Id: <20221019083300.374919732@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747124058261538492?= X-GMAIL-MSGID: =?utf-8?q?1747124058261538492?= From: Uwe Kleine-König [ Upstream commit 32f7eed0c763a9b89f6b357ec54b48398fc7b99e ] The mutex might still be in use until the devm cleanup callback devm_led_classdev_flash_release() is called. This only happens some time after lm3601x_remove() completed. Fixes: e63a744871a3 ("leds: lm3601x: Convert class registration to device managed") Acked-by: Pavel Machek Signed-off-by: Uwe Kleine-König Signed-off-by: Wolfram Sang Signed-off-by: Sasha Levin --- drivers/leds/flash/leds-lm3601x.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/leds/flash/leds-lm3601x.c b/drivers/leds/flash/leds-lm3601x.c index d0e1d4814042..3d1272748201 100644 --- a/drivers/leds/flash/leds-lm3601x.c +++ b/drivers/leds/flash/leds-lm3601x.c @@ -444,8 +444,6 @@ static int lm3601x_remove(struct i2c_client *client) { struct lm3601x_led *led = i2c_get_clientdata(client); - mutex_destroy(&led->lock); - return regmap_update_bits(led->regmap, LM3601X_ENABLE_REG, LM3601X_ENABLE_MASK, LM3601X_MODE_STANDBY);