From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D9B8C433F5 for ; Tue, 15 Feb 2022 12:26:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236814AbiBOM0t (ORCPT ); Tue, 15 Feb 2022 07:26:49 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:35596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229997AbiBOM0t (ORCPT ); Tue, 15 Feb 2022 07:26:49 -0500 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3916C6D4EA; Tue, 15 Feb 2022 04:26: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=1644927999; x=1676463999; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=mAOEDZwZltc79R8ljIE8KX8QQVn+66VpKFi11FYX9sU=; b=EIRnqus/hw2MB3+g30fZIVTkAA6ie9U1gepphGQMgCYF7bcFVdxdDTtg Jw4Rspe+xJvqyIffeEDop8Tg63yWWPERS1LJmpduO+Lgf4VsgK9KPUbix N7S4GNlcJEl3HyGDag0JG541eXnE3huoLcj0aFQUpZF+GA0Bf5BOT5wDc AMdm62Z1GMvuKUdypqTTe+hZFDnQK+loJuk/jbe1gDhJbJ46TN2cQ3D31 QTrExDQW4Bz0y8CcDgSpOKiQM9mtgEV1xVENcGQikC/5MPUDWAkEgJfIS uxhE3Sze9hDRH7xlQYMI/V2sk501L54NIYP6GKgzMO4gC1OM6STU9yZWS w==; X-IronPort-AV: E=McAfee;i="6200,9189,10258"; a="230303529" X-IronPort-AV: E=Sophos;i="5.88,370,1635231600"; d="scan'208";a="230303529" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2022 04:26:39 -0800 X-IronPort-AV: E=Sophos;i="5.88,370,1635231600"; d="scan'208";a="624765025" Received: from smile.fi.intel.com ([10.237.72.59]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2022 04:26:37 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1nJwtq-004upb-TR; Tue, 15 Feb 2022 14:25:42 +0200 Date: Tue, 15 Feb 2022 14:25:42 +0200 From: Andy Shevchenko To: Jiri Slaby Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Qing Wang Subject: Re: [PATCH v1 1/1] serial: 8250_mid: Balance reference count for PCI DMA device Message-ID: References: <20220215100920.41984-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org On Tue, Feb 15, 2022 at 12:08:26PM +0100, Jiri Slaby wrote: > On 15. 02. 22, 11:31, Andy Shevchenko wrote: > > On Tue, Feb 15, 2022 at 12:29:49PM +0200, Andy Shevchenko wrote: > > > On Tue, Feb 15, 2022 at 11:11:41AM +0100, Jiri Slaby wrote: > > > > On 15. 02. 22, 11:09, Andy Shevchenko wrote: > > > > > The pci_get_slot() increases its reference count, the caller > > > > > must decrement the reference count by calling pci_dev_put(). > > > > > > > And what about the -EINVAL case? > > > > > > What about it? The ->probe() calls ->exit() in its error path. > > > Or did I miss something? > > > > Or you mean that we call pci_dev_put() on NULL pointer? > > This is completely valid case and handled in the callee. > > No, I mixed up patches :P. This was meant as a comment to > "serial: 8250_lpss: Balance reference count for PCI DMA device" > > byt_serial_exit() isn't called when byt_serial_setup() fails with EINVAL if > I'm looking correctly. I see now, thanks for catching this! I will send a v2 soon. -- With Best Regards, Andy Shevchenko