From patchwork Mon Oct 24 11:28:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9052 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp442854wru; Mon, 24 Oct 2022 06:08:16 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5pyDPppDC5k1OJ3j10ouowk53SPw9ybkXPzaC0u9Xv4IAPx+6N627JmY+yZDdTt9Fm56tk X-Received: by 2002:a63:8942:0:b0:46e:c02e:2eb5 with SMTP id v63-20020a638942000000b0046ec02e2eb5mr13909243pgd.141.1666616896596; Mon, 24 Oct 2022 06:08:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666616896; cv=none; d=google.com; s=arc-20160816; b=idCK6jTwwqwE/4AZBSEODVxvc4g9OlTK1uVBwgmPSx8CQE1bt/pDlayA09kzmNZabs sRzlqYCIRUYNRaljVtInFFOP/5eta0YqGd8jS14Cih01BZEFeCbFD5PGm5gOrdgSLwPU Fq+mztNEK+GWEb4Qg9L0ioTZ86LOAS6njtVOtyX7JgMoVtQyL8vA3t9ZMlRosPiVtrv3 64jxjscMYWBHP6tcGOkqlMJC9vcs8yeAWUFddb4MmejZw/gLJScXZLMO6i5U9fxoBJyI dHl1dcf3IcPvRhGcDKl1eius7xaC/0FW4JP8rFH3B7wOzui6ucLW2KRT5RQgiD+Vi4MR 9PKg== 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=FxP8tT6eyVu7nv5a42B920pgQ2+LVokTr+HFeQWW8Uw=; b=uzLyuIre8/qUJCR+mI9l6q7T5lPG5PR0gisB4TnXrHNbmxNZxRXXXIS3qtSKeTQK5D /FgYyiXJHEiBHIhaLir0gvir6nrW+Tm/sRzCkNrE58F2p5zzInuXwlW57H1kZHN3Ppd8 iySpBfouu44nN6AW7EL9YQoEVy9X4vLYfnv61hOSOC9RikM86Cpxc9PY13vFX/mae5Xy HC95Q2qvKgcfJ3XSzX5O5dFdK4X19UdRVqrqui35pjexUXSRYNbzpo6X6sG/cEXwcXZW GeLDWQD38luVVQ4WwzayMEIK//lQg/5dc5du2kFk4BNzWFXvameaiYQIrqWhRL565srh 437A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XSxeO6gD; 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 b7-20020a656687000000b0045160a30fcasi31643366pgw.388.2022.10.24.06.07.59; Mon, 24 Oct 2022 06:08:16 -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=XSxeO6gD; 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 S235451AbiJXNGs (ORCPT + 99 others); Mon, 24 Oct 2022 09:06:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235448AbiJXNEs (ORCPT ); Mon, 24 Oct 2022 09:04:48 -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 19E3A28E05; Mon, 24 Oct 2022 05:20:32 -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 AEC246121A; Mon, 24 Oct 2022 12:20:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C3FFEC433D6; Mon, 24 Oct 2022 12:20:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666614019; bh=sIn65kFsw5TkwhcgJC0jUs3XxU0PmlPv+E8myZA6wO8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XSxeO6gDX1vx/8IKmv1YxgebKq8sGp/FSbB8Q4UZiHVDbdM49uavXqC6Yf25sLYzp AitMfqHVbXHiBJt1jK8TGorAJBfCtYaWCE+vnMCJQM3gLebKtDMs/z5L9QpJSV1ow8 9bXE1qEV5Sn9EMHvDh1D+XUoizWGQqhVTXPu7qPw= 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.10 101/390] leds: lm3601x: Dont use mutex after it was destroyed Date: Mon, 24 Oct 2022 13:28:18 +0200 Message-Id: <20221024113026.973380803@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113022.510008560@linuxfoundation.org> References: <20221024113022.510008560@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 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?1747574479206039262?= X-GMAIL-MSGID: =?utf-8?q?1747574479206039262?= 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/leds-lm3601x.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/leds/leds-lm3601x.c b/drivers/leds/leds-lm3601x.c index d0e1d4814042..3d1272748201 100644 --- a/drivers/leds/leds-lm3601x.c +++ b/drivers/leds/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);