Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2356026imu; Wed, 21 Nov 2018 10:18:00 -0800 (PST) X-Google-Smtp-Source: AFSGD/Vaj0udkGuJIrypzWS1yoSVJPWHtqaQbT18cZLo/jo44hWtG8OYs1IQpw2SSpAUwYvrxjCU X-Received: by 2002:a17:902:292b:: with SMTP id g40mr8007277plb.82.1542824280338; Wed, 21 Nov 2018 10:18:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542824280; cv=none; d=google.com; s=arc-20160816; b=oQyjjr6+S9gri2yNsofeGOTJBFy2n/+jg/a6EFKrIbT0moNmaoWppvvbR8NVz/eI2x WKhfXN9Bi2yK5bD5qbsEjYOlbxrcohe+qyqxkXQgqjFAhNoaP7ybhydWcOGjJgBLGmRC m8e/dBBOAmjv7YeIAXSO4r8mmm0Su2in7844BNhzL8Ndjf1BnRWZPl7DP9IPhx6kBmSM E2ZvaeJcJkHJwlof4qwpdhtUuGplOtjtfM7hnEh8dlzW00UYnYUwJLdGBJkrhj+IMF1A yVoZ3u+p4u1QSzFU235LnEMeDOEgwwSwGu/jTit+mV/L/FhaVvXVdO+B2GyzOeGsaG7J UwQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=thkELfAxvTwr1N4EbyhLIU5J715IkVEuVYHX9Z2jW60=; b=MtbLBa/a3hCH6c2B95IePr/AwMDqh1rc4PrGU0lMUbaauwLs/TtQltQZefZnWYi248 6IMlgHjSnd4ScomlaydN1j1b3ExNWqzCLPmYdjaOD69cSVZBM7eOReuB3J9zHY23p3Uu o78IHCWkhesj504d3D7C0UWb1z3wD7bT1OgIZbTQlEuoQbKiDpTFNIs4aZhl0i1PgVSs AE4SZoB+9PX6NYWMSgIjjHQIJb8bSugyWxhnF7VqkKPpJmKgAZ1RPmX2UET5Zm3WKi1q yrBpxEewyMzlTBJIPdB9Ay+WGqzC3D3Wlp3k5J96VB3jqE4zIZNW9T76u6qWIBcbCpZJ ej/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EFr8lgGl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m11si20078093plt.26.2018.11.21.10.17.39; Wed, 21 Nov 2018 10:18:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EFr8lgGl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731393AbeKVCJB (ORCPT + 99 others); Wed, 21 Nov 2018 21:09:01 -0500 Received: from mail-it1-f194.google.com ([209.85.166.194]:35404 "EHLO mail-it1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730072AbeKVCJB (ORCPT ); Wed, 21 Nov 2018 21:09:01 -0500 Received: by mail-it1-f194.google.com with SMTP id v11so9462912itj.0; Wed, 21 Nov 2018 07:34:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=thkELfAxvTwr1N4EbyhLIU5J715IkVEuVYHX9Z2jW60=; b=EFr8lgGl/6h84hxoxmWgIaCMT2UNfAeF0vQ4FR2toDNCbfyXnBt+QN6zCytKna7YwK dGv+rAcdhWFs/M2oqKoofvgU7dFSnNdpbpqVNdrFzQUlbPLPFUZQEXiwPeZg8X8RqU19 5op64jsb6Krv3Pk9tMBcxumU8l5otbFi0/I0JpHMCx7UEel+VLTUoZXYHmQmZlgaKfug qvs8VidiR0vFwBV5OIISGZaqaFpIH3kviBx/DzrKyvOskiwoLr4LLtWEv60qpQ7PTca3 xCnReqV+nqC23akb0/ceWrMYN4WgCaS/TdJpCyNg7QO+emtuXm6BY/iSzj5EklUBmIxd C7Lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=thkELfAxvTwr1N4EbyhLIU5J715IkVEuVYHX9Z2jW60=; b=dzScsxL4Xnup6j7TL/0rgG6/xnIj4uASpvoX17UaKRdnICt3tLq8ft9v6L+MsNridd rcJXVdCwn8rNhJUjAtTMRoUM9+EjYyashbO6Yn80CdmgFmUgeLyMQLEfzeBmgBFt6XMG 6+HMFosnoRMV5r/TmILyDvC4Ys2eGOLxcs6fqUunIvPn9ESA2Qurkwf9o5lXCw4we3I+ 5T9NhDc8xwVER/QZO0C584+kHD/v1hd4Jl57WGYCLlX2kSlpMTFVRRDSt7sykpwH/kpZ Fgci7GNjtPqJdnoVGg8K4pxF+lYzkHIq7Mpp24sC2BVWhdtTvHOBrruCokWrIM/9TmMI 86NA== X-Gm-Message-State: AA+aEWYknOTb/cNhfII7uGPGsPgb/Hb/UMS3NMsmMGsehdxGbcAKnrs5 AzK0rfR0QrNvVQJTVrUXKw6/hTDT0W5+ZZEv3Pxo5dCDYkA= X-Received: by 2002:a02:5184:: with SMTP id s126mr1632705jaa.12.1542814445924; Wed, 21 Nov 2018 07:34:05 -0800 (PST) MIME-Version: 1.0 References: <20181121130439.22255-1-tiny.windzz@gmail.com> In-Reply-To: From: Frank Lee Date: Wed, 21 Nov 2018 23:33:44 +0800 Message-ID: Subject: Re: [PATCH] ata: pata_macio: add of_node_put() To: sergei.shtylyov@cogentembedded.com Cc: b.zolnierkie@samsung.com, axboe@kernel.dk, linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 21, 2018 at 11:31 PM Frank Lee wrote: > > On Wed, Nov 21, 2018 at 11:24 PM Sergei Shtylyov > wrote: > > > > Hello! > > > > On 11/21/2018 04:04 PM, Yangtao Li wrote: > > > > > of_find_node_by_path() acquires a reference to the node > > > returned by it and that reference needs to be dropped by its caller. > > > bl_idle_init() doesn't do that, so fix it. > > > > I thought we're inside pata_macio_cable_detect()? Hi Sergei=EF=BC=9A Yeah,this is a typo. Need me to resend a patch? Thanks=EF=BC=8C Yangtao > Hi Sergei=EF=BC=9A > > What do you mean? > Why not release the refcount of root? > > Yours, > Yangtao > > > > > Signed-off-by: Yangtao Li > > > --- > > > drivers/ata/pata_macio.c | 2 ++ > > > 1 file changed, 2 insertions(+) > > > > > > diff --git a/drivers/ata/pata_macio.c b/drivers/ata/pata_macio.c > > > index 9588e685d994..8cc9c429ad95 100644 > > > --- a/drivers/ata/pata_macio.c > > > +++ b/drivers/ata/pata_macio.c > > > @@ -483,6 +483,8 @@ static int pata_macio_cable_detect(struct ata_por= t *ap) > > > struct device_node *root =3D of_find_node_by_path("/"); > > > const char *model =3D of_get_property(root, "model", NU= LL); > > > > > > + of_node_put(root); > > > + > > > if (cable && !strncmp(cable, "80-", 3)) { > > > /* Some drives fail to detect 80c cable in Powe= rBook > > > * These machine use proprietary short IDE cabl= e > > > > MBR, Sergei