Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp2329990rdd; Fri, 12 Jan 2024 06:30:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IGYe3YH1Jp5S2dh5z03NQkA+tCF1uaP8eVfzVCtwkP8nuoafYrj0qHgQSdbx2RcoC3YXNeO X-Received: by 2002:a05:6214:1944:b0:67a:ba4c:6f69 with SMTP id q4-20020a056214194400b0067aba4c6f69mr1459380qvk.22.1705069832959; Fri, 12 Jan 2024 06:30:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705069832; cv=none; d=google.com; s=arc-20160816; b=ZG14JtZKDzzirOp9ClNTfzuWZAez1p+CrlY1EDj4zRLVfbu6w9lrR32kFDRIkHuH85 7U2AF4nt5T5ICHxKoYzpbEsTcq/MYdpNtPlqZff8EaKkil8cOzPl1uV4Ce5+I8VYLNou 4VAP3+LsA8RtFfw2iYP/VzqYlObjee2NrT8v9NABIh8bQ+yqqNlNtm7/tROCywQ1hm65 DNeS6f2nBx1ZLUD0tCEBbRYPGdg1wduJXJ6wVulvbQHn07fQlE6r5lzQkmaLDLTuLONq Xa8NQT2zinz+gOLgIAE8oT6ty3nPskSiy8nBgho9clSKzmHlEQePeFU/WiEBrikAad/C SalQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature; bh=NmU6FjbcYWnssDfQrvaQbMBGWJvzjg9Ug1O6rh+F1fk=; fh=FhN9SAx4DdNVBn0jM5xDLJr+CZ9HsufCs0WIsn4YZkI=; b=QO1/mc0NpteItaCTTOxPVhglKQ1S2WnzW4xarbPkzQESq0UzNDXf6Zn9PybdzEBWQ5 M/W5xwX8E9PCQ40qrQoS0RviV0GENetMGWGiYEV0LcmNFzr0D5WAHyDydzYWeQhWPNPk JMfyXoNEceLKwlgL8GURHibXIIiztSjIzjnzwTaxutX/nHdW6ShoMcazfjWECGIufNwA L04a4ltjYLvOPi1krsYzmxTgbXA3Wn7xYjMgKcmZZOJuQEn4n47o4cXU2Y2bnQ6w8UUo qjhl6Y5pLhvD61siOBGhvKgWih5tvX+ZNFUt+P1eBfMrqsTsgCEIiCwFFWqXPGxsfbYU pqeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=l5+sjcVK; spf=pass (google.com: domain of linux-kernel+bounces-24753-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24753-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id s7-20020a0cb307000000b0067f74a8de8esi2799405qve.501.2024.01.12.06.30.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jan 2024 06:30:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-24753-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=l5+sjcVK; spf=pass (google.com: domain of linux-kernel+bounces-24753-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24753-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B14A51C22036 for ; Fri, 12 Jan 2024 14:30:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EA0786DCFD; Fri, 12 Jan 2024 14:30:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="l5+sjcVK" Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9FDB11EB50 for ; Fri, 12 Jan 2024 14:30:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-3368b1e056eso5158708f8f.3 for ; Fri, 12 Jan 2024 06:30:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705069822; x=1705674622; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=NmU6FjbcYWnssDfQrvaQbMBGWJvzjg9Ug1O6rh+F1fk=; b=l5+sjcVKPWv0AmoRsvIhU619nCCT0WLMtH9zQM+ezBSTUM9njuqsECNh7k1ItdpPFr A3T+OWURLkTvVilRDvsQAptG8czVLg1VWUCDaNOyeRYIcSXzbAeiedN4qKsMxhRFiSqE yzFA6kI/Gmc7DhB2pHXSV6107G2HF1UOV7/6e9YwJ8Kff1UC1cv9jAKwrLj6uMzyE10p ZgjNDi06+B7tNlV6sEUjmh9aZeG0vbuXK8ahZ6h/d32yIq3M9ti7L9WtL1Ng8mblHVde A1kUbSBdsCD28Sm3/gbi7ZhYt4+9k4sTMo9v3gDDbp9yLKy0FGzV8k32uyOXNEReevY7 aRow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705069822; x=1705674622; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=NmU6FjbcYWnssDfQrvaQbMBGWJvzjg9Ug1O6rh+F1fk=; b=JhsGkYRNrFu2Sjcy0wcYlnsVuBDPaO2TJWOAmk+7QtINYYbvoh3i+zct4nee0sovMk Ew5zqVj8ZXiOnidczBbwq22xt9BhpIBfxp1tOny9r1MT7z4klg1QXITujOCOR6h2yzvL paEuhpnkHwMzNVt3octAIIZ89B924pubZs3GVxx0cBwAGZzHUWXX6u3W1JXmkiTtrUIY UfmBq3sPxCEuT6yrzZqAhRTVfPkZu2EU4vYuVrbZA5OtPS0UAZyWl4uXEtX0KHC54XOl XntFFuJbVBhWyI5jyKdVtC3kShDouUkdaWN/QCBB9CPTkOAsUWPL0eCEqawVv2hLnIey xZ4w== X-Gm-Message-State: AOJu0YyTvKWh+gaioxsYl8Amj/aEyiQGLgeYpEGXhwjaMjUSr9+lMtgo 6sRoc/Xqm1s3W58n3MjS6UOo8m4ZskB1jg== X-Received: by 2002:a05:6000:10c4:b0:336:6514:a97f with SMTP id b4-20020a05600010c400b003366514a97fmr716022wrx.106.1705069822073; Fri, 12 Jan 2024 06:30:22 -0800 (PST) Received: from localhost ([102.140.209.237]) by smtp.gmail.com with ESMTPSA id a8-20020a5d5088000000b003364a0e6983sm4010911wrt.62.2024.01.12.06.30.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jan 2024 06:30:21 -0800 (PST) Date: Fri, 12 Jan 2024 17:30:18 +0300 From: Dan Carpenter To: Daniel Lezcano Cc: "Rafael J. Wysocki" , Zhang Rui , Lukasz Luba , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] thermal/debugfs: Unlock on error path in thermal_debug_tz_trip_up() Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Mailer: git-send-email haha only kidding Add a missing mutex_unlock(&thermal_dbg->lock) to this error path. Fixes: 4731c8f16a0e ("thermal/debugfs: Add thermal debugfs information for mitigation episodes") Signed-off-by: Dan Carpenter --- drivers/thermal/thermal_debugfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/thermal/thermal_debugfs.c b/drivers/thermal/thermal_debugfs.c index a3fa09235da1..a3f06029fc54 100644 --- a/drivers/thermal/thermal_debugfs.c +++ b/drivers/thermal/thermal_debugfs.c @@ -591,7 +591,7 @@ void thermal_debug_tz_trip_up(struct thermal_zone_device *tz, if (!tz_dbg->nr_trips) { tze = thermal_debugfs_tz_event_alloc(tz, now); if (!tze) - return; + goto unlock; list_add(&tze->node, &tz_dbg->tz_episodes); } @@ -619,6 +619,7 @@ void thermal_debug_tz_trip_up(struct thermal_zone_device *tz, (temperature - tze->trip_stats[trip_id].avg) / tze->trip_stats[trip_id].count; +unlock: mutex_unlock(&thermal_dbg->lock); } -- 2.43.0