Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp5608096pxb; Mon, 28 Mar 2022 14:54:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrZGc8X7osHukzsuJfyPlk/xfrphU6UbhMlvBKHNqcEv5g9Zn0IAH/pr+ukihCDtU49j4w X-Received: by 2002:a63:4d60:0:b0:36c:8803:b92d with SMTP id n32-20020a634d60000000b0036c8803b92dmr11490961pgl.179.1648504496401; Mon, 28 Mar 2022 14:54:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648504496; cv=none; d=google.com; s=arc-20160816; b=KLOPVhqxJcGKqyBvQV5j46OWDb/PzuSTA12ntw6YUveRtel+jAvkRrgTVm4MHVm44F LTHJoZT9Y8JZpxrx53xNqWdn4QC+UhBxrrxTFRD53kx0j/2LtE9idbsmmMd0VOFgPMFX k0vuPGxLYRR/+9XXol2T6eYYGN99Rxps4MkzDP4+PGSwmR13HGUBvNi+1om7Gjhhs+B+ n2p9/f7g50s1TXHw6sjE+fhicU06Aa+vEKZ2Ck3JGaIE2rl31fgUNEKPZiw/aV9THL5l wVDuBtQcDrJ/xYAhFZf2LTEWXOXhixETw032RrptVGK0kHB4KEtNezV8E6kWc2+0RBGP hOBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=Y3opIRTQR50fC2yCAeMxirRwSn7n79Kh7DLzizNRa+4=; b=fZKF5csVUawRYZLi8sXYln2ErL3GlPuaMBV2IxwITJdOJm1uQZ+HHkodjSfF475KMj 0LMdorGV3URkPMVocGfiT+jjS7n1zefa+WCBohLt5kl3WJfPmmu/262KoTym/tTtKOim r3A8xuG5tOg2P6GmiAY9wU48VYSgeO9E7+3VZfDw3V7S1kKSQU0Oy154kP3bLeCVeZi0 FeKUnqZVZzJkw1vnzl8CucbNlFvswb0RvBQWW8PuoHfe2MYJipMKW8Sat0JoVqEBez57 KuAxnU8pUdmi2LIZHkLe4rjBsUfJ1kpoWx9tncjRniBawJhYmi7XUm0cavfgudrCTjYU /o8Q== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id r23-20020a62e417000000b004fa3a8e0027si14314132pfh.222.2022.03.28.14.54.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Mar 2022 14:54:56 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 58C131A3A6; Mon, 28 Mar 2022 14:23:35 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245667AbiC1TwF (ORCPT + 99 others); Mon, 28 Mar 2022 15:52:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344917AbiC1TtJ (ORCPT ); Mon, 28 Mar 2022 15:49:09 -0400 Received: from smtp.smtpout.orange.fr (smtp08.smtpout.orange.fr [80.12.242.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A66176C93C for ; Mon, 28 Mar 2022 12:45:34 -0700 (PDT) Received: from [192.168.1.18] ([90.126.236.122]) by smtp.orange.fr with ESMTPA id YvIgnQ611uvBOYvIgnOLTK; Mon, 28 Mar 2022 21:45:15 +0200 X-ME-Helo: [192.168.1.18] X-ME-Auth: YWZlNiIxYWMyZDliZWIzOTcwYTEyYzlhMmU3ZiQ1M2U2MzfzZDfyZTMxZTBkMTYyNDBjNDJlZmQ3ZQ== X-ME-Date: Mon, 28 Mar 2022 21:45:15 +0200 X-ME-IP: 90.126.236.122 Message-ID: <78d00a13-3cee-386c-07f1-8d16a24e4e67@wanadoo.fr> Date: Mon, 28 Mar 2022 21:45:14 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH 1/2] ia64: topology: Fix an error handling path in cache_add_dev() Content-Language: en-US To: John Paul Adrian Glaubitz , Tony Luck , Zhang Yanmin Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-ia64@vger.kernel.org, Andrew Morton References: <452b20c160a20754022407acefd2abb170f43d14.1648494330.git.christophe.jaillet@wanadoo.fr> From: Christophe JAILLET In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Le 28/03/2022 à 21:16, John Paul Adrian Glaubitz a écrit : > Hi Christophe! > > On 3/28/22 21:07, Christophe JAILLET wrote: >> If kobject_init_and_add()fails, kobject_put() needs to be called. >> Add the missing call which is already there a few lines below in another >> error handling path. >> >> Fixes: f19180056ea0 ("[IA64] Export cpu cache info by sysfs") >> Signed-off-by: Christophe JAILLET > > Thanks for your patches. There is currently no maintainer for ia64, so the patches > would have to go through Andrew Morton's tree. > > However, I can test the patches and verify they don't break anything. > > Adrian > Hi, digging deeper for other potential same issues in other file, I don't think that this patch is needed, and I don't think that it fixes anything. The "name" of this kobject is "%s", "cache". So nothing needs to be freed for that because kstrdup_const() will be used. This kobject has no .release function. If the add() part of kobject_init_and_add(), then 'state_in_sysfs' will still be 0, so nothing needs to be released for that either. So, adding a kobject_put() would just be a no-op here (if I understand correctly). I've been puzzled by the kobject_put() later, but in this case, _add() has already succeeded and state_in_sysfs=1 and the call is needed. For the other patch, it is just a clean-up. Based on Wikipedia, IA64 is discontinued, so such clean-up does not make that much sense either. (on the other hand, it should be eay to review and apply :) ) I don't think you need to spent time on it. Sorry for the noise. CJ