Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp501168rwb; Wed, 18 Jan 2023 21:47:08 -0800 (PST) X-Google-Smtp-Source: AMrXdXuA+wZjx1rIxndQzW+/N6/hGCq9+L7+yZObMn6G171Il86TAT70GZLI966wFbTOW0UvI8Jl X-Received: by 2002:a17:907:6e02:b0:84d:2eb0:57d6 with SMTP id sd2-20020a1709076e0200b0084d2eb057d6mr13532105ejc.52.1674107227899; Wed, 18 Jan 2023 21:47:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674107227; cv=none; d=google.com; s=arc-20160816; b=E1+pl6NVDILTyrld/7NAaoSVW6sTNR6TJE6JAgSbKOCqRxm3cOzaV3Sms51k6FeHKB hUj5t2MBm8ftQq0jlqCTjxu1de6fJEFP8XPTkXOqzJDghto6ZmPo9j0U/icVjobTlNYE Oz/0s1rYBbxbPeL6wTHCMnVC4ocvHwLMztfe/U2EvwZOqvAu3PgOxMthEsltAHOhZoi4 QRKQUU6HCsSkJcffB8FAx74bnMztQJiYymC0yF+klTbgJxnAh2pmGFLwvMoKeeKxEE9o 2GBoHXxAjgxgZkNPUrchEwluKQKKceqkychvNnj/AttBpcgdlZv3NdVCIXoYQEUlc6bt jjxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=FVamRwg47e7JomZYS51/vFhQgPnkTMn8aAsEafDtbAQ=; b=Oifeg9vIXSulURDWqiFfjC7Gxc5Nh62Rl6M9KtnaSOq3wzzCvbIm+UmtL9qSQO0ecL zdhUfJOGj2SfUbZnUJY0bQeAYxqrjxTQFYdvLeqk+C8B+B2K+nAkxJBBEPdiSSuD8qPk zM3wAdOn6IBvj94w8rndHplCKShoy7xsh3ZQuWfTQfGvH5Vb3rFE/IEoPVLv8lZqgakz 4ibz9J1++fuH/FAD+RNpeP+yYmHeeVY9fWpQYAxE54SA8rdNvKeUnQXFbIeIQFbYHvxP EpMLhiHctciL2yWxaC0SUipYdIoGDdMUnV1uB8Anf1uXGbOLzWwby2M1ozXXwECSZWfx iDDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="MFge/j3m"; 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 js21-20020a17090797d500b008697a71e4e9si16294787ejc.941.2023.01.18.21.46.57; Wed, 18 Jan 2023 21:47:07 -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="MFge/j3m"; 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 S229518AbjASFQc (ORCPT + 44 others); Thu, 19 Jan 2023 00:16:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229459AbjASFQa (ORCPT ); Thu, 19 Jan 2023 00:16:30 -0500 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A24CCA for ; Wed, 18 Jan 2023 21:16:28 -0800 (PST) Received: by mail-pj1-x102a.google.com with SMTP id o13so1294109pjg.2 for ; Wed, 18 Jan 2023 21:16:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=FVamRwg47e7JomZYS51/vFhQgPnkTMn8aAsEafDtbAQ=; b=MFge/j3m75+cZ8vY8wmYW63HFOJqHiWd3Pdhn/69Mx/Dri4LxllCHnx+BKs5f8czes yYAj9oWFFHXmC+hmuDEmQLC8dcBBI2POx1fRwR/5A0AP2+Jbjrh9+Ut22z7C0mYWun8i YnZQgVWGQ9MiFjaWN4yObw59YzcuyliXqdRGYl1nXaPl05kVQmdooeJTq1iGM4jngryB m8RKB6f1F1ISPS7+hUKUvXY5cjLlibn76LiQe6TEy+tf4VDtLteFdCK8xH2g3VNewvm+ 4leX7Hx6RHJWi0kzVVvtbgchj1OSh2QZGtNli7S3SF77WzH1y7I6DX3X6UgaKv7bOysa Tpiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=FVamRwg47e7JomZYS51/vFhQgPnkTMn8aAsEafDtbAQ=; b=GI+TqkuY1LNWzZe8WnDiKJlqn38spQuTM3sGVfW3mL4xGU2girKpS/7PnbsvmJkf86 mercgEGshPO4pk9SKbZ3ozx6ZYTTM4VkNz7Qsi4FnVjEg3BX95dq8FJ/AbdLqiQQSb+m Z7I2HOJtmH16Tm1TQS++hvagYah55fKEXiGV6+SUtLL6DFSsxv20zIL/KMDrL+EsdsTZ aeiDCxeEndr14a+Pj3Y7DB7BtEGk5XIaX/iFLZ/cITWRlwcWQL0A6cZ39FnbvaOHSQmP fvuqfbs8h5yOUrR9tIwVMqAX6u5mljvO0EOdldzBdiSDUGO1eJQVVkYa00W5EJGF7atQ OP8A== X-Gm-Message-State: AFqh2koKJ+xlACgGOXEYlXYBq/9wDh/o2CBNHuTaThbEOjdmwbTS4K4/ Cab1ZajRSZ1Iq5dacxV/YHHl4g== X-Received: by 2002:a17:902:c24c:b0:194:7696:b0f9 with SMTP id 12-20020a170902c24c00b001947696b0f9mr22640309plg.66.1674105387586; Wed, 18 Jan 2023 21:16:27 -0800 (PST) Received: from localhost ([122.172.83.155]) by smtp.gmail.com with ESMTPSA id n8-20020a170902e54800b001894198d0ebsm9529061plf.24.2023.01.18.21.16.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Jan 2023 21:16:26 -0800 (PST) Date: Thu, 19 Jan 2023 10:46:25 +0530 From: Viresh Kumar To: "Rafael J. Wysocki" Cc: Daniel Lezcano , Amit Kucheria , Zhang Rui , Yang Yingliang , linux-pm@vger.kernel.org, Vincent Guittot , Caleb Connolly , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org Subject: Re: [PATCH V4 1/3] thermal: core: call put_device() only after device_register() fails Message-ID: <20230119051625.bd4dtnriw6jys6nt@vireshk-i7> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 On 18-01-23, 20:58, Rafael J. Wysocki wrote: > On Wed, Jan 18, 2023 at 9:38 AM Viresh Kumar wrote: > > > > put_device() shouldn't be called before a prior call to > > device_register(). __thermal_cooling_device_register() doesn't follow > > that properly and needs fixing. Also > > thermal_cooling_device_destroy_sysfs() is getting called unnecessarily > > on few error paths. > > > > Fix all this by placing the calls at the right place. > > > > Based on initial work done by Caleb Connolly. > > > > Fixes: 4748f9687caa ("thermal: core: fix some possible name leaks in error paths") > > Fixes: c408b3d1d9bb ("thermal: Validate new state in cur_state_store()") > > Reported-by: Caleb Connolly > > Signed-off-by: Viresh Kumar > > OK, so I think that this patch is needed for 6.2 and the other two may > be queued up for later (they do depend on this one, though, of > course). Is my understanding correct? Right. -- viresh