Received: by 2002:a05:7412:1492:b0:e2:908c:2ebd with SMTP id s18csp524217rdh; Wed, 23 Aug 2023 07:16:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFtaeU4kbV77UgkRZe9BQeujuZIzj8d3dkCh7FJtmzPomYi0xymtqCR0acu/C38QLqhHkwb X-Received: by 2002:a17:902:c612:b0:1bb:7b6c:983a with SMTP id r18-20020a170902c61200b001bb7b6c983amr11172067plr.59.1692800205830; Wed, 23 Aug 2023 07:16:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692800205; cv=none; d=google.com; s=arc-20160816; b=UkOY3bP0vg0MdNjo3xpCPLIKsELNf4r2Wk942hXtXTRB+MRimO8I6Un/vosd50eCrc Uiwv1uyAuLwy5fD6yXCEP8VFwQE5BXRDZ6fovN3JVO8k6fOSylFzYtIggdLAqHoWd5I+ ENjcGcCuYFJXAXzrrvjvdllKhCwYmO8m7KAnbOM/bcOaLJV3GFw9lJMMj1pDToIRPfLV xdWTi/nFycgJ1uJmkf16ZBwPkS1D4qrxh/9WPZWQ27N6N35pTPc5ll/V05EVrWYr8GyE 0kFUslENk9xDrEiA4Af4XHDrHFIYbE3L61eYGuj4imiUkaUoFMWffIS9ZGvNLfplCN3s mx4g== 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:date :message-id:subject:references:in-reply-to:to:from; bh=0JkCuRiemH7Y+0aEvy5zvcy9pUHZ2juOkx9vCLlYvY4=; fh=ZG8unIuyocg1G0TidXUK0Co/6TsQQk0LwoH/mIZu6wA=; b=Jqfg/Kmpv+xBp66xElTe9+ZbmuQjgMXZlh87T+3bbb95b0dSVc73UHy5y5UQP1Odre 9S1ui2OC3FwV4weXQx5yLvTySsxyh/P0oQvePYdiUVbKW4eheIjXZNUVnAADmFz1McIc iUD7/hFXoHBvZsGQ6FujdH+7v880z0RrWrCi6Cz3wlk+PJtmnqrdCnHu/zLMKnypQh6J aSoh46JYOGo9xdBhK9rmfCKAxDpZeHLbe+wBVqs2W3yk3IACRwAlVuTJjYJ4pfMmCjVG mkyC5COFDYv6A8DMINaiEuOcPKYzcFgjEVQBoRMpT2kUTHeDVa2yBKTm4Jnxgdzz0MJO 54GA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e5-20020a17090301c500b001b9c1821f6bsi11887487plh.98.2023.08.23.07.16.33; Wed, 23 Aug 2023 07:16:45 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235012AbjHWMQF (ORCPT + 99 others); Wed, 23 Aug 2023 08:16:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234823AbjHWMQE (ORCPT ); Wed, 23 Aug 2023 08:16:04 -0400 Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CA20FB for ; Wed, 23 Aug 2023 05:16:01 -0700 (PDT) Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4RW4dg1Bs0z4x5p; Wed, 23 Aug 2023 22:04:39 +1000 (AEST) From: Michael Ellerman To: npiggin@gmail.com, christophe.leroy@csgroup.eu, windhl@126.com, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, ruanjinjie In-Reply-To: <20221110011929.3709774-1-ruanjinjie@huawei.com> References: <20221110011929.3709774-1-ruanjinjie@huawei.com> Subject: Re: [PATCH] powerpc/pseries: fix possible memory leak in ibmebus_bus_init() Message-Id: <169279175567.797584.15288361947822567301.b4-ty@ellerman.id.au> Date: Wed, 23 Aug 2023 21:55:55 +1000 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,SPF_PASS autolearn=ham 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 Thu, 10 Nov 2022 09:19:29 +0800, ruanjinjie wrote: > If device_register() returns error in ibmebus_bus_init(), name of kobject > which is allocated in dev_set_name() called in device_add() is leaked. > > As comment of device_add() says, it should call put_device() to drop > the reference count that was set in device_initialize() when it fails, > so the name can be freed in kobject_cleanup(). > > [...] Applied to powerpc/next. [1/1] powerpc/pseries: fix possible memory leak in ibmebus_bus_init() https://git.kernel.org/powerpc/c/afda85b963c12947e298ad85d757e333aa40fd74 cheers