Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp1396952imp; Fri, 22 Feb 2019 02:40:16 -0800 (PST) X-Google-Smtp-Source: AHgI3IZDr1/PapuGUKMVKnS4akFXsnyxDG76GOI9OaPO5UYlUVy9KSbRsiTsfiPRHlmFP+Yj2X6a X-Received: by 2002:a17:902:9304:: with SMTP id bc4mr3585742plb.81.1550832016052; Fri, 22 Feb 2019 02:40:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550832016; cv=none; d=google.com; s=arc-20160816; b=HRWOCeA0Y/rLP25Kpeezc6kg+hrshqX3NU/kgFimnh7avfYkUyjflCUqjgbJLVJN4K wrSAzXH3nfCwMhKzy1zoFDJZBsRE+ScBNNAHZ0WxNntMdieZLympTmUuovOlNHERUfTf Jk3GyErt8mHoMensyAaz2ubzQSqVS0fJqKopcvRdylII5VLH/6ErxXHJIwL+9A2C7R01 kNJlkxg5yvWiCQwViAWu6MRDKHWO2vkUpWiYRfBDvr674zvJWos5dxgFkjsKUBjINR+c dotoPPbARtSDzwrzg4dLdGqukgr4qqIkU4poPslwP9QRaO5x8xtvbwaeSpu4GFijrkUw GUhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=6Ycd7F6cSiLogdbx9zRwsP3cV/l35t97ZLFFQbqW0ZY=; b=UEPu2WAlj5ZoZ8Ucac2SUJlyxGOLEtYo/MNh2DEaJdvtS/zr589u87AiGeXulJ43eu PIE8jJZmKeOMuXMrkx+0IeidQXUwLjEvN5T0dJe7LYzuAaJvpzlidyzYWvpSwQYj6s+j V6r4y131wjtIEr+sov/LdDzkphrHOwNZe6ZU4VgHlXvC9AU5h7eFJxzPk6eoWfkkpL4f gNs+N4ts8NHEjaU0t6leh4bTYKm5y6Rtwu3h+0MwHBck5YaPXMiCQjMTh3ASro/nzMLh OnELGinTacVcMLmSgDGrIT22W2wIHl4VUBbZlbeCp8q0aLJPEeZ5KoAtHE3Prf17GbEw kZmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QmkpmZUi; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u21si1052888pgn.404.2019.02.22.02.40.00; Fri, 22 Feb 2019 02:40:16 -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=@linaro.org header.s=google header.b=QmkpmZUi; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726337AbfBVKjI (ORCPT + 99 others); Fri, 22 Feb 2019 05:39:08 -0500 Received: from mail-qt1-f194.google.com ([209.85.160.194]:32855 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726132AbfBVKjI (ORCPT ); Fri, 22 Feb 2019 05:39:08 -0500 Received: by mail-qt1-f194.google.com with SMTP id z39so1950872qtz.0 for ; Fri, 22 Feb 2019 02:39:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6Ycd7F6cSiLogdbx9zRwsP3cV/l35t97ZLFFQbqW0ZY=; b=QmkpmZUiBTbZ9js+DH1S5VXOUAULuAZLuoblV0v5GDDP8QKc/2qBF5QRoA0o/FFWAz 3bL3NDQsR6+GvMRWf6Ie4uXz7E6nFW8STIGANrpojGfO9FMKmvc/m8QYfPkArk7o+/RO VV6PeDdL4GccW0ZhsrpKl1UARJCLKHkrZr4/79GXkEKLKfhBiiRIkqmhC/BYdA8jaPJT /x8seq3Z19RbpG2VQiMSJTaFzBvjBUa9g8emCTfnkLbhAD7VmBgCRT31WTgqiYNLSRzx LJwPCe4snAZD57HLfztU41cAiqw45/onngw+tJKzTBe4zr1VM2wLyKbxho96GCtqdnwc snIw== 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; bh=6Ycd7F6cSiLogdbx9zRwsP3cV/l35t97ZLFFQbqW0ZY=; b=pUntOUsPdDwnM/2fEljzTju24GxD2NBV63jOiW8kpY1dO1oFbycGAPg3VO0pZjWX7p RXLRSbg+Q30Bp3fTr5HrQKb9R5bz5ZUSRCg02qoSGP5RxMhHrdubPOj2E1SWLa+mkHW2 WnEubouXTofL+2bxxW2eaXWZC4Gz6mvYwlb1UDiUJ5rBvuVSqoD5ul7qLNBOrL8V3I57 WaSxTFhU/8mb7SJDW7Yh7lKoKk2qoV0Vcqphl5269RGHA7WHHei9zeFDovNGAnZtFzsu cF1UtP3yEh9Lotn+dCSilxb6vUbcoR9RKbj2gexrfHUttJkQFXrctNWKevuLR1pc2txb hYsQ== X-Gm-Message-State: AHQUAuYPE/Gx6EeN+dG4YBRdeiEAPozIt1ZSiamYVnD07kDT6xbP+6eB JeCjSl9ARZq8FnkCTqwUkj5PukY6zgPNOG7oICBKOg== X-Received: by 2002:ac8:1bf7:: with SMTP id m52mr2568003qtk.200.1550831947420; Fri, 22 Feb 2019 02:39:07 -0800 (PST) MIME-Version: 1.0 References: <1550819742-32155-1-git-send-email-wen.yang99@zte.com.cn> In-Reply-To: <1550819742-32155-1-git-send-email-wen.yang99@zte.com.cn> From: Linus Walleij Date: Fri, 22 Feb 2019 11:38:53 +0100 Message-ID: Subject: Re: [PATCH 1/5] net: dsa: fix a leaked reference by adding a missing of_node_put To: Wen Yang Cc: Andrew Lunn , Vivien Didelot , Florian Fainelli , "David S. Miller" , netdev , "linux-kernel@vger.kernel.org" , Alexandre Belloni , UNGLinuxDriver@microchip.com, Felix Fietkau , Lorenzo Bianconi , Kalle Valo , Matthias Brugger , linux-wireless , Linux ARM , "moderated list:ARM/Mediatek SoC support" , anirudh@xilinx.com, John Linn , Michal Simek , wang.yi59@zte.com.cn Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 22, 2019 at 8:15 AM Wen Yang wrote: > The call to of_get_child_by_name returns a node pointer with refcount > incremented thus it must be explicitly decremented after the last > usage. > > Detected by coccinelle with the following warnings: > ./drivers/net/dsa/rtl8366rb.c:510:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 501, but without a corresponding object release within this function. > ./drivers/net/dsa/rtl8366rb.c:518:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 501, but without a corresponding object release within this function. > ./drivers/net/dsa/rtl8366rb.c:540:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 501, but without a corresponding object release within this function. > ./drivers/net/dsa/rtl8366rb.c:548:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 501, but without a corresponding object release within this function. > ./drivers/net/dsa/rtl8366rb.c:556:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 501, but without a corresponding object release within this function. > ./drivers/net/dsa/rtl8366rb.c:561:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 501, but without a corresponding object release within this function. > > Signed-off-by: Wen Yang > Cc: Linus Walleij > Cc: Andrew Lunn > Cc: Vivien Didelot > Cc: Florian Fainelli > Cc: "David S. Miller" > Cc: netdev@vger.kernel.org > Cc: linux-kernel@vger.kernel.org Acked-by: Linus Walleij Yours, Linus Walleij