From patchwork Sat Oct 22 07:21:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7274 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1092017wrr; Sat, 22 Oct 2022 00:52:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7UorEqS9fbupYbVZqiZ84R7DJQ4ijzwLL0i0NOnNPvfo4iOgdWe8hrO5ooHMbqL4X9Iz3T X-Received: by 2002:a17:90b:3e83:b0:212:de17:952c with SMTP id rj3-20020a17090b3e8300b00212de17952cmr3601840pjb.102.1666425159965; Sat, 22 Oct 2022 00:52:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666425159; cv=none; d=google.com; s=arc-20160816; b=VDA9RDnOTsjqkMXb3y3MvDEzYsF3F7iSMDWYaNZwaZadGCQYYjx9Fa7ubDo5x7JAYd OkvgmjP4CUbEJoPvADWAcI5rVPDdMauq1MnfQgRjTe6t3WUrDyf9EbABPqEVZxcIV8VD 9TtRvW2hWviJVWZFXUcS48ngRtFqi3Et9P4tTaMhvZmLGvV5UlvOnmxz0v/A+Mish02+ TtN9a834SHgARMNZ/1v9P+EZqC69gJqWaWYTDxq18CdS2R6tZg3/AkkVvuDCg05qLMve glFaltVk341vsE0wuoAQ09sL8wMtBkY5vstHWeN9/YegV0AzwCSfAKxLejDo87S4UZOG zSzA== 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=URmpIjI0+vqwfCUnjF959MNCTKwcEBvIRjy9I4xF1H8KAEqSmDeaNJwOPNtu6sOvs1 SgL8OYaP/ShSPWuyMVrly/Klmpk6BRE3BulPxYXn6VcRzasJPslW/Wpg8equgT1AhV+p eCIcqD1P6s3+a0Rsouj03QP69ef/LaWidxY4EEE6x+E9Kp6L4rmPyFM3MFueG8cKeEkH ywD28Z4ny3UVzwjp2jP9zr31+N0sMlITGNS5xXE+SmxgeC8us80L+iB2YM9/ZBCP+GoV Wh+p2CFnzr8RJVgw6ciwucyZxnYAWr6AYdxuYCIcBNSQAFv+RwjzY2e62jDEL7judnoz RNJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DixVuT6v; 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 y13-20020a056a00190d00b005363fa9e126si29540868pfi.358.2022.10.22.00.52.28; Sat, 22 Oct 2022 00:52:39 -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=DixVuT6v; 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 S230309AbiJVHwM (ORCPT + 99 others); Sat, 22 Oct 2022 03:52:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231888AbiJVHte (ORCPT ); Sat, 22 Oct 2022 03:49:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 032552C1719; Sat, 22 Oct 2022 00:46:12 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 89F4860B9C; Sat, 22 Oct 2022 07:43:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9ACADC433D6; Sat, 22 Oct 2022 07:43:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424595; bh=oyGyxWJUXiy5R6FcVcV6T7cfpWGfVqEQbstwhBlVSqA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DixVuT6v7wnQx2d97pacbEK0CPnMVW4P+fCUJ9viKRvzFtgnCp+D34iqV/OztQpLf bVV9H39oybBWzLI0K2osECdcwK+GeCRqvKBhnBgZui/xe41/dvTbmXg8xy0d4Iy1HG 9VG2tmbTgnXu3ja8bRAEhvNIExC1r2TlDC4h2Y1A= 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 5.19 205/717] leds: lm3601x: Dont use mutex after it was destroyed Date: Sat, 22 Oct 2022 09:21:24 +0200 Message-Id: <20221022072451.627694420@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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?1747373428427226467?= X-GMAIL-MSGID: =?utf-8?q?1747373428427226467?= 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);