Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3859389pxb; Tue, 10 Nov 2020 01:44:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJy3K7FqhocerwDtX8bsNTgGtOT3vNqhJT20/H07QhyzYFCZWmHpIw1c6bB75VtnILd9Csk/ X-Received: by 2002:a17:906:31cb:: with SMTP id f11mr19102046ejf.142.1605001491302; Tue, 10 Nov 2020 01:44:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605001491; cv=none; d=google.com; s=arc-20160816; b=Rs5tF2noWFztzprskShcn9qIpytO0gPit+JjFKrBy/54vkmWXgGBzzwrMq67jKecqZ ahlyjUGNx6zDkAxYGVW1As18Q7ECDEku9qW0ROOmrpQRQLM0ZhSnIj4wH0qD48SU7t82 moinpBGfERwIhQ9L1YNtXzSl5bBe1A4/t81Jg+6oYFpS39pt+yddoFnIBa+c2nFOVcIG PMbQ3xQbLdd14rKu/Wrfjupt74WGvnhdRamapN8MHDWyNtv7/y8C61lPBDSL1owinKrv 125shc36YXg6yrgGenyDcz7mkPUp4G5gRdrCrOqcYWuC9+8cu0rPuHOcMQqJ3oVojoBJ v3jw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=j4SZz8Jjd/2gfUFLzKFrvyEzAHX2qjjB45wJ6JZCEuM=; b=sxTV/c/I4nQzuPPSWq3wcRp2kCzo9tqsPEtwNN6431gYeO75hwmlnLzihsBAOb6zSb 72VBUswkCPVhqAUXx7eeXk6jjiTXFXa9bC6TuEslti9KlmPpvMOo34eASGW0DWR9pWQN v+91NoIYzDN6MnRHScDI8v7k3rn/RZUHZ1HCzDCfpvMewA/EDgBxB1t9QLjfevBFUKnC bfWWOgekHbW3N0m/kK9RHqcFPWf8QEPET/P/fcPyLbdrftyioq+g/3TyvTQCcuj70OM8 LBLp58roky3b4wHfKvGZzHhiqqTzIlu1CN4C3TSDlfd+7Ow62ebLUMR3APf7I9jbvWe0 2hpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=u87o0P5q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ca2si8772842edb.502.2020.11.10.01.44.27; Tue, 10 Nov 2020 01:44:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=u87o0P5q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730234AbgKJJmM (ORCPT + 99 others); Tue, 10 Nov 2020 04:42:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726721AbgKJJmK (ORCPT ); Tue, 10 Nov 2020 04:42:10 -0500 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4E36C0613CF for ; Tue, 10 Nov 2020 01:42:08 -0800 (PST) Received: by mail-wr1-x441.google.com with SMTP id p1so11900062wrf.12 for ; Tue, 10 Nov 2020 01:42:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=j4SZz8Jjd/2gfUFLzKFrvyEzAHX2qjjB45wJ6JZCEuM=; b=u87o0P5q+g9l9YvZ8TeELxX93vwA0/C6p1/p/0vmZk1QQe2Q7ovB3ySOGlIIBAya+L FiFD1r603raA6Ll3qj5pZq3pg6hBTYQBS0vo+YlrOBKcWHpmc4r9d4GoMMQdBKopEBtU VjHJSBhA2AbxdldTIdKWFIo4848Aaoo6UWXN+1T258gvIAZ6df8d+6xthcJESq9uPUg9 Dj2mDnYSRmywDXuEzF4sBNaTMQCxaaLSyj/XpHPFGsIflNOEaKpovAYi7+D7paKDt4nV NkJ+wQLbxamAj7jB5zV9AoAfL0HN3RsZut7uIkJhDVrI727gdwgIfRHED6FwpskhR5a2 8Byg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=j4SZz8Jjd/2gfUFLzKFrvyEzAHX2qjjB45wJ6JZCEuM=; b=Akx2eA3WjSYyea9+1Gp4lUgDF+/vO0lQCanhDPDUe6+BR518fj5b/Hm07rZH61emMX Bouc77Zb0u5uFJcGz238MtwW2qOIZ3cYlNHfNXUIY6pirPaD9MGa0B58nhfHe0U1L98d 0k8y8sQ54IfTCHtwGgPmbWpM9fCwoaHCy7MWVHubtlbtS1gEixXzANyH0oc1N7Wl/SAP E84OCOOqu9UMEzeoDRcbAwVV4QO+PKcWchUZQf4KpMN7VIHq7Vdp7eX0DLS1KtHyHEGh 9FWgYpy0wY6lfV++tw+SnxgaCZOtTQ7MZ8fq/kOrndyJ6dCddGuudT4RnHeuYTC82jcX gDFQ== X-Gm-Message-State: AOAM533N9W32AxTIQZm+1f9p948hnLHUKQKk+qKycYVT05WljtyWhluQ axHnxPIaN/h35dGIGVia5LLD7A== X-Received: by 2002:adf:fc01:: with SMTP id i1mr7781477wrr.250.1605001327497; Tue, 10 Nov 2020 01:42:07 -0800 (PST) Received: from debian-brgl.home (amarseille-656-1-4-167.w90-8.abo.wanadoo.fr. [90.8.158.167]) by smtp.gmail.com with ESMTPSA id b17sm16445377wru.12.2020.11.10.01.42.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Nov 2020 01:42:06 -0800 (PST) From: Bartosz Golaszewski To: Alessandro Zummo , Alexandre Belloni Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH] rtc: destroy mutex when releasing the device Date: Tue, 10 Nov 2020 10:42:05 +0100 Message-Id: <20201110094205.8972-1-brgl@bgdev.pl> X-Mailer: git-send-email 2.29.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bartosz Golaszewski Not destroying mutexes doesn't lead to resource leak but it's the correct thing to do for mutex debugging accounting. Signed-off-by: Bartosz Golaszewski --- drivers/rtc/class.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c index 7c88d190c51f..e09b3f34ffdc 100644 --- a/drivers/rtc/class.c +++ b/drivers/rtc/class.c @@ -28,6 +28,7 @@ static void rtc_device_release(struct device *dev) struct rtc_device *rtc = to_rtc_device(dev); ida_simple_remove(&rtc_ida, rtc->id); + mutex_destroy(&rtc->ops_lock); kfree(rtc); } -- 2.29.1