Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp11626687rwl; Tue, 3 Jan 2023 02:10:32 -0800 (PST) X-Google-Smtp-Source: AMrXdXvQN0Rxa709ncUqw4o6Nfk2wP5uo9oVdqYxJCBOF9Q7Z0cNiLGR2mDmXEA0dpDSbZOD5LK4 X-Received: by 2002:a17:902:ba93:b0:192:4a70:3f57 with SMTP id k19-20020a170902ba9300b001924a703f57mr42364026pls.8.1672740632010; Tue, 03 Jan 2023 02:10:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672740631; cv=none; d=google.com; s=arc-20160816; b=FD6bRzjI/9IYg3WQ1NCvVIHdR4OEacTfcl7oVnkzA7HpBTxP1UJuIm7DGyHPnBiexR GP0z99YtBWcLIrFIGpqrDItaigcnnBX5JK80wH6iQ//3Ajv8rTmbXmyw5b8ntQsGAozQ TQ2GxnPEgT+Et9B3+uo7KxQxvB7wGQ+A1fqNH5sOPgDboYPxs768AEqB2LDGBgKAF5HB bmCnPRK29KkwBqKiWGcTai4JCsCj+reSDtbY0Fi23FXDmCFVx9MDfIxi0x2bvEmUVfST Zg7LdvSdnZoiuHepYp3JsX2LFjygS5P6BFYecrt4+1oBRnsSpx+XYMEB0rREtwAYVWIq VfFQ== 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=aRH64uFpsdBpMUPNGj2VyCFulJ5HdrrXgg5C5a2lIbQ=; b=GfRxGV8dIoVZTEmVYmnI6ohXZmZ66wtcJzYPj2MjzXVdK6f0i9n2+yoBX2vuXVNIJR b5XZgo1eKPmF+ubA6FtR/1awy7nzZDos5w1cP+Q97aSJV06LGTUDvyHeZ+elEOoUCZEv euEVCN3tX54SMjgsreYoAxXPVTK0ARm9vV3mDkpgNSaYfb8arJQqmV/k6VdcmnZxSRAL IrpfqBwdmfdMiOb4pNuPTtEEBK17RX5zoWFJ4Nnb4lJXyz49MVhbUhsktnxgLSbxV/yH VN+5/crugNmaqt4XyfkdrUwl1CD/udaOZAgA4h/6Dcde5ZudBoNldnj8jE7Tn01ggEeC HgMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=h5cjDmV6; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h2-20020a170902f54200b00192721d4f1fsi30188798plf.494.2023.01.03.02.10.24; Tue, 03 Jan 2023 02:10:31 -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=@intel.com header.s=Intel header.b=h5cjDmV6; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237037AbjACJbm (ORCPT + 61 others); Tue, 3 Jan 2023 04:31:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232910AbjACJbk (ORCPT ); Tue, 3 Jan 2023 04:31:40 -0500 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7272AE3C; Tue, 3 Jan 2023 01:31:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672738299; x=1704274299; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=UApoLp6+oH1gi/b0JWDUcLwn1ffTUCy2mro5a6NzxgA=; b=h5cjDmV63HT0rxkPB0X8a7Zgp0+bI9lxeBjTnJooKsNHIdgunddw3Prn 4uLoADArAKI1mPSoySBU2dYf6J8C5pJV/7Jop41uRObjRTb3ufTeOVUuA k2MpUpCYstRtN218xS7EW9WICFDALOMPuV0S7Vlul5Ek+y7CHCh1+lbmZ JG+BRv1PoSr9Bzv3LwI7tEk0ChH+CvzKn87muVTTrBWxx7j/BKrglhccM qcCMelco5NwhhDITYAGBcyd9aRy6mlmeikblE5kYh4m/JMMNANmptuR4N 90WAVEzrEvuDVMIPfUCTSHsvx+fFJJU0uPrN689AmOaD3TB4psaAacIBN A==; X-IronPort-AV: E=McAfee;i="6500,9779,10578"; a="383921004" X-IronPort-AV: E=Sophos;i="5.96,296,1665471600"; d="scan'208";a="383921004" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jan 2023 01:29:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10578"; a="797131070" X-IronPort-AV: E=Sophos;i="5.96,296,1665471600"; d="scan'208";a="797131070" Received: from kuha.fi.intel.com ([10.237.72.185]) by fmsmga001.fm.intel.com with SMTP; 03 Jan 2023 01:28:55 -0800 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Tue, 03 Jan 2023 11:28:54 +0200 Date: Tue, 3 Jan 2023 11:28:54 +0200 From: Heikki Krogerus To: Andy Shevchenko Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman Subject: Re: [PATCH v1 1/2] usb: typec: intel_pmc_mux: Don't leak the ACPI device reference count Message-ID: References: <20230102202933.15968-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230102202933.15968-1-andriy.shevchenko@linux.intel.com> X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, 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 Mon, Jan 02, 2023 at 10:29:32PM +0200, Andy Shevchenko wrote: > When acpi_dev_get_memory_resources() fails, the reference count is > left bumped. Drop it as it's done in the other error paths. > > Fixes: 43d596e32276 ("usb: typec: intel_pmc_mux: Check the port status before connect") > Signed-off-by: Andy Shevchenko Reviewed-by: Heikki Krogerus > --- > drivers/usb/typec/mux/intel_pmc_mux.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/typec/mux/intel_pmc_mux.c b/drivers/usb/typec/mux/intel_pmc_mux.c > index fdbf3694e21f..87e2c9130607 100644 > --- a/drivers/usb/typec/mux/intel_pmc_mux.c > +++ b/drivers/usb/typec/mux/intel_pmc_mux.c > @@ -614,8 +614,10 @@ static int pmc_usb_probe_iom(struct pmc_usb *pmc) > > INIT_LIST_HEAD(&resource_list); > ret = acpi_dev_get_memory_resources(adev, &resource_list); > - if (ret < 0) > + if (ret < 0) { > + acpi_dev_put(adev); > return ret; > + } > > rentry = list_first_entry_or_null(&resource_list, struct resource_entry, node); > if (rentry) > -- > 2.35.1 thanks, -- heikki