Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp6180650rwb; Wed, 18 Jan 2023 02:06:54 -0800 (PST) X-Google-Smtp-Source: AMrXdXtjlaxh9vmLJZaIo6KQf7d26r4z6lWiY5wuQQIvJR87wPJi9tRBMDKFnA2C/Sz374EacV+m X-Received: by 2002:a17:902:6e17:b0:193:39c4:cf55 with SMTP id u23-20020a1709026e1700b0019339c4cf55mr5276515plk.17.1674036414263; Wed, 18 Jan 2023 02:06:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674036414; cv=none; d=google.com; s=arc-20160816; b=C3HeL7eomIj+0jIDZdp0g/WObCh64WcCd9rxYmUxsQT8FAScftZjUU1ZgEPICIL9/k U+XPRkGbgMaF5G3W7CBG0FM0oIMKp5bYVr2Gc0V/0fj118Z62raWRRnO417lkdZ/zz7N UVWjDErwARxjdDRmcSLIwfZALnnRstx4acfWHN7ufq+gACHMRU+rn0f2dwylTLy4iIyP /OXIKS+Ky/QVZfqllhr5D57fN2GjvhevlRRV3AqPmtDKih20OKGY4PPdvXL+dfzkRxdu UZypjPGHl4r+AqNGP6mPRmCgNm9hfftsxdn9OtMKWynx0tGiXoefz2OgT3M0gBFec/pU XP9g== 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=8Seq1mX1XtKCwlcIcPQRmNyguKpAMYVn4ufk1mjtx/c=; b=IFqpAtuCCaMS6JkbiTDz0MWLFW5iaZrFNDtUd+jVXUeQowhI0rczXm5K8dLmB/i3BZ WkUSUuXkInPPJ6nYlmrZOag/LQ245qWI105mFFV5Vszrei1I/2Hnfw7zaICrqADPeigC hDzlqNyxshgBLQnXQgHO6PVI79VH2zYm4O5OOFxmgtQ9zCVzj1LWqwt9qcGHIi3kHwmc 1FrEwE4C6PYswp6vHYTO6/fSfC/z6+8Q1iKGfbqcRuxwzM9W+71FllaRV3gjPeWt0oIN 3VMHjx+aD810wOnJwqB1gmF7cHyWCyUQaUO5XgTfmtPvNa0V5V/son4W9h4UvU7G6HCa zuvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H8yMg62C; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i7-20020a170902c94700b00192d3104c4bsi14145975pla.514.2023.01.18.02.06.46; Wed, 18 Jan 2023 02:06:54 -0800 (PST) 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=@linaro.org header.s=google header.b=H8yMg62C; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230363AbjARJb4 (ORCPT + 48 others); Wed, 18 Jan 2023 04:31:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230265AbjARJUh (ORCPT ); Wed, 18 Jan 2023 04:20:37 -0500 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 421B65B44C for ; Wed, 18 Jan 2023 00:38:32 -0800 (PST) Received: by mail-pf1-x42a.google.com with SMTP id 127so8326355pfe.4 for ; Wed, 18 Jan 2023 00:38:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=8Seq1mX1XtKCwlcIcPQRmNyguKpAMYVn4ufk1mjtx/c=; b=H8yMg62Cq5wI/wHrn1Gcd5A/7UHoJqQ4Mc7NinTnr/5hGSO48NgbHgNQa2QuBVBHbN VJ/PSuW7KKTckTfWhC8lDoLWSpKEOynWhuH/7iskzZjvs8yBrnWYFOLH80zf2l9Gw59M XHUbEQxjaJKBLZLzxO9gYb+ZR2xX5ADI+P8oSTHiJNVH39HPPHqS5YqOqvb3b0h/rUI1 0kXBUhgR3QjmsFl8l9T82o0xjBIGLcjidI2pWIOtagtqYjwtcQspYcV5YBQpjQpwM7bf AEPyic5C+u2QiF34C5tmEdiKMSUXuUvCatYasrKADxfUMeljP4QNsj900ZTbuEqTthgK S+Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=8Seq1mX1XtKCwlcIcPQRmNyguKpAMYVn4ufk1mjtx/c=; b=iS7rvZgxNwiMeSI8TkcccmhktoYh2rY/Nprs1b7dVWM4ciDohBVu7As+Cqy+86xhDP YgZdGymInkoiqTPiG5zl2EnyrAzHT69rWWqfA4gZny4/PrV+p1KnPx7jF+9XB0oPdyRs bjxfBOxP5EtPQdzvBmaC4xM+yPaEMOONkluFpkgEd6Zjtx1vAbpgU1OrXqGguCWH+/uA jaLyVpclBRJm5lETRKOdCXcYInanZUF5D2ufAQp5NjXZAratjf1Sfk6s4x/GPMs2+M8f 2ukhi+9lT0gG9F1w/VeqOCUqZmzIJ8bicZnS6Okk9qlr1+72DIwRJXk86R27iFX9IdB0 VPzg== X-Gm-Message-State: AFqh2ko1gfSwYgOAS2FO8JG78aAS4XUUr0zBEreJ2TzVXRYBdgzLmMhg WuxqXCeg06SSVKVlaJ3/B45n2w== X-Received: by 2002:aa7:8283:0:b0:588:9c15:65c4 with SMTP id s3-20020aa78283000000b005889c1565c4mr5481132pfm.3.1674031111722; Wed, 18 Jan 2023 00:38:31 -0800 (PST) Received: from localhost ([122.172.81.45]) by smtp.gmail.com with ESMTPSA id d62-20020a623641000000b005800cb7cbcasm19709245pfa.120.2023.01.18.00.38.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Jan 2023 00:38:31 -0800 (PST) From: Viresh Kumar To: "Rafael J. Wysocki" , Amit Kucheria , Daniel Lezcano , Viresh Kumar , Yang Yingliang , Zhang Rui Cc: linux-pm@vger.kernel.org, Vincent Guittot , Caleb Connolly , linux-kernel@vger.kernel.org, "Rafael J. Wysocki" Subject: [PATCH 0/3] thermal: Fix/cleanup error paths in __thermal_cooling_device_register() Date: Wed, 18 Jan 2023 14:08:23 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 Hi, The error paths in __thermal_cooling_device_register() are trying to free un-acquired resources, fix that and clean it up a bit. Caleb, can you please test this? I have just build tested it for now. -- Viresh Viresh Kumar (3): thermal: core: call put_device() only after device_register() fails thermal: core: Move cdev cleanup to thermal_release() thermal: core: Use device_unregister() instead of device_del/put() drivers/thermal/thermal_core.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) -- 2.31.1.272.g89b43f80a514