Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2639378rwb; Mon, 19 Sep 2022 07:56:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7oGS/cEIQ70sQCe2dfMf82qH/ITdyGn0xIuTK+wN+FgCRS9uaLp/OKpF+tnPzyYF+Ag1Qv X-Received: by 2002:a17:902:d0d2:b0:178:1047:1cce with SMTP id n18-20020a170902d0d200b0017810471ccemr143659pln.150.1663599360091; Mon, 19 Sep 2022 07:56:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663599360; cv=none; d=google.com; s=arc-20160816; b=HHN1rp+FZKgzZPXX8mKisE11isP+4qK0Z2ycQi1TRXaiDk7zhlMXjhr0c8Bfdp/ARA I/6WtAY2RJTELtSIcY4gSfvJ2USqHOPZZYDPEsl12QJxRteEDdBAe96s+e61JyJiNcKO r52aLolzQdW4xS4K+XUMLV+nZbkN1HD/bDP3KSH0sYmMT4ldtQ/TtMvR891PSOmOeweo RaUKVhRYmaQSr5YoYaVVxRf40m+79qVCuxbCkCzKUVpSGurrhCohb7KbVLCgctbhmNhr vzDOvy+JK8dGDihKwOaIc9I7f3NklbMliBIEgWLWCcH8WrfJVvsbrZcpNVXKUN38Y82p Y2aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=xeBfU3ZkKgod5AzExXxFmZF+kGGyZZi7/n/49/scyj0=; b=AaFRHEgeyi8y6ZfPZvax7M8OaVO34oIH8do7e6aetTu2jTDCziZCcwGgs3GVNrqXyo 8AQq50ICfCC6A3R6xvmvjqIXRUYvw6LRPkj9pQ0KmTGudgtHjFmrkkMSLMlz7xrnf56X dj4NewQM/9wkaCAqS7bC6crdwqR79ffnGKLaGvMEHBnDecwTeqFN1VFnm/+YlRcOqhp7 MOgFm3iMxearFBKjsm+Nr2SdnIzwufZbSNMU8idrRiducXWPAVA7b5t0U0BlKXporJSP OjA27A+SeK8f1yMsHMN4p2OZlx5E7IJy9BJ3jSemCk40IwJibehtHRBLyZEhEiVMuryv FtHQ== 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 t2-20020a056a00138200b005383d4f38bcsi32349117pfg.206.2022.09.19.07.55.47; Mon, 19 Sep 2022 07:56:00 -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 S230041AbiISOvU (ORCPT + 99 others); Mon, 19 Sep 2022 10:51:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229549AbiISOvI (ORCPT ); Mon, 19 Sep 2022 10:51:08 -0400 Received: from elvis.franken.de (elvis.franken.de [193.175.24.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D59D03334D; Mon, 19 Sep 2022 07:51:03 -0700 (PDT) Received: from uucp (helo=alpha) by elvis.franken.de with local-bsmtp (Exim 3.36 #1) id 1oaI6u-0005ft-02; Mon, 19 Sep 2022 16:51:00 +0200 Received: by alpha.franken.de (Postfix, from userid 1000) id 32702C12F2; Mon, 19 Sep 2022 16:48:14 +0200 (CEST) Date: Mon, 19 Sep 2022 16:48:14 +0200 From: Thomas Bogendoerfer To: Lin Yujun Cc: christophe.jaillet@wanadoo.fr, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH -next] MIPS: SGI-IP30: Fix platform-device leak in bridge_platform_create() Message-ID: <20220919144814.GB7674@alpha.franken.de> References: <20220914032807.96793-1-linyujun809@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220914032807.96793-1-linyujun809@huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_NONE 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 Wed, Sep 14, 2022 at 11:28:07AM +0800, Lin Yujun wrote: > In error case in bridge_platform_create after calling > platform_device_add()/platform_device_add_data()/ > platform_device_add_resources(), release the failed > 'pdev' or it will be leak, call platform_device_put() > to fix this problem. > > Besides, 'pdev' is divided into 'pdev_wd' and 'pdev_bd', > use platform_device_unregister() to release sgi_w1 > resources when xtalk-bridge registration fails. > > Fixes: fd27234f24ae ("MIPS: add support for SGI Octane (IP30)") > Signed-off-by: Lin Yujun > --- > arch/mips/sgi-ip30/ip30-xtalk.c | 70 +++++++++++++++++++++++---------- > 1 file changed, 50 insertions(+), 20 deletions(-) applied to mips-next. Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]