Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp6394023pxb; Tue, 15 Feb 2022 01:13:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJzSj6LbKXdyzZjpm//90b4kkJC0kApF86vYAh46187jMDmKPmQEZzdb0TACe6BNEgQmBlbq X-Received: by 2002:a17:90b:f88:b0:1b8:ad41:e200 with SMTP id ft8-20020a17090b0f8800b001b8ad41e200mr3265571pjb.1.1644916398982; Tue, 15 Feb 2022 01:13:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644916398; cv=none; d=google.com; s=arc-20160816; b=0qHuuL0SzduvApK+4zlWSHlZDhz2vzVT/CnQ29O0uW0q4A06PrmdSO+NeywCRvE27T BeUV3ciJJrBMaAKH5XDiEp1hBompV6T5v7sK3WN+cw98ujLlEKipSPL4oW6jLOy08kwi Des3k8FSaF0rilkilZCkzIdg/4kir+46gMMX5G2gX+gcclCaNkk6tEVn+RI+LWfeDdmX G++2Kma7YYjV88g9IxOdCJmc7NREwr/MbnKyNZboOSfzAq78sym5VLRyn1hThAxZlekc MEbw6FwVRvtrWAOneh1XpfVo0jGxCU77C7mIEwMgvW7aXjr7WsYYqH5jSwu0as4+LRdL O95g== 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=UwnW06zj0g80RUuelIiJ0F8+iR+y0xRLwHnBJAjCmyk=; b=Kct0XF+FGoxRvYjrsukj2n9HqLfy6023VndtZhuFnHngLfpELlXT3nfD2JO830T6u7 VNx9UoFxrnxSfF/LEr+pR7ej+deXlQDJKzMXB9ti9Q3ZMLWgYYwfkEwVHZcZ7d3Wz7GV hgvrHeekRVrUOMyaqHeZykIKN6aeMwEK0axClDg9Syt0J3R2HTfoGBXgez2wV498eJyE /kbNsIieToUlVuj5WFUD0OOO5LH1gvZLq+LrVMN0FnWuZ9xsmREjWIWrhzoBupNC2nFH 5B83tMdplEZ8jltZSsSV0sIDWlzM/EHueqloqbdkZd5BOqK0lCpeO0N5Xz6knNbZLzbU j/8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uZ9GS4jr; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w27si4955649pfj.235.2022.02.15.01.13.04; Tue, 15 Feb 2022 01:13:18 -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=@linuxfoundation.org header.s=korg header.b=uZ9GS4jr; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233770AbiBOHqU (ORCPT + 99 others); Tue, 15 Feb 2022 02:46:20 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:35270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232017AbiBOHqT (ORCPT ); Tue, 15 Feb 2022 02:46:19 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B258A107DBD; Mon, 14 Feb 2022 23:46:09 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 189A0B80E70; Tue, 15 Feb 2022 07:46:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1BE8EC340EC; Tue, 15 Feb 2022 07:46:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644911166; bh=3lB9kUJK8jxkLP3rCA6Ubvf8NJBzKM22raR92qKTb/0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uZ9GS4jrDWdg/MMzlceTdBPLLQ8sJQojB5NiM7B2LKAacCoxsnX/ByWyu4doEst0F z0NA2B29/k/O9GoagQtITR9jTgXqvTB9RCdWlithxAj2sejbQRNv4/jwtEEgOaVNuc OwkNikfdjuNXCPbyFin6x/H6xzY7Wr9Bw0JOoANE= Date: Tue, 15 Feb 2022 08:46:03 +0100 From: Greg Kroah-Hartman To: Qing Wang Cc: Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] tty: serial: add missing pci_dev_put() before return Message-ID: References: <1644890472-65306-1-git-send-email-wangqing@vivo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1644890472-65306-1-git-send-email-wangqing@vivo.com> X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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, Feb 14, 2022 at 06:01:12PM -0800, Qing Wang wrote: > From: Wang Qing > > pci_get_slot() increases its reference count, the caller must > decrement the reference count by calling pci_dev_put() > > Signed-off-by: Wang Qing > --- > drivers/tty/serial/pch_uart.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c > index f0351e6..da5a276 > --- a/drivers/tty/serial/pch_uart.c > +++ b/drivers/tty/serial/pch_uart.c > @@ -723,7 +723,7 @@ static void pch_request_dma(struct uart_port *port) > if (!chan) { > dev_err(priv->port.dev, "%s:dma_request_channel FAILS(Tx)\n", > __func__); > - return; > + goto out; > } > priv->chan_tx = chan; > > @@ -739,13 +739,16 @@ static void pch_request_dma(struct uart_port *port) > __func__); > dma_release_channel(priv->chan_tx); > priv->chan_tx = NULL; > - return; > + goto out; > } > > /* Get Consistent memory for DMA */ > priv->rx_buf_virt = dma_alloc_coherent(port->dev, port->fifosize, > &priv->rx_buf_dma, GFP_KERNEL); > priv->chan_rx = chan; > + > +out: > + pci_dev_put(dma_dev); > } > > static void pch_dma_rx_complete(void *arg) > -- > 2.7.4 > What tool are you using to find these? As Jiri points out, it is not very correct at all, be careful to not cause bugs when you are attempting to fix them. For stuff like this, please always test your changes to verify they work. thanks, greg k-h