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 X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E3B5C6778A for ; Fri, 29 Jun 2018 18:37:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3255C2152F for ; Fri, 29 Jun 2018 18:37:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3255C2152F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755388AbeF2Shb (ORCPT ); Fri, 29 Jun 2018 14:37:31 -0400 Received: from mx2.suse.de ([195.135.220.15]:46592 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752683AbeF2Sha (ORCPT ); Fri, 29 Jun 2018 14:37:30 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 24873ADC8; Fri, 29 Jun 2018 18:37:29 +0000 (UTC) Date: Fri, 29 Jun 2018 20:37:28 +0200 Message-ID: From: Takashi Iwai To: "Nicholas Mc Guire" Cc: "Johannes Berg" , , , "Jaroslav Kysela" , Subject: Re: [PATCH] ALSA: snd-aoa: add of_node_put() in error path In-Reply-To: <1530292062-31567-1-git-send-email-hofrat@osadl.org> References: <1530292062-31567-1-git-send-email-hofrat@osadl.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 29 Jun 2018 19:07:42 +0200, Nicholas Mc Guire wrote: > > Both calls to of_find_node_by_name() and of_get_next_child() return a > node pointer with refcount incremented thus it must be explicidly > decremented here after the last usage. As we are assured to have a > refcounted np either from the initial > of_find_node_by_name(NULL, name); or from the of_get_next_child(gpio, np) > in the while loop if we reached the error code path below, an > x of_node_put(np) is needed. > > Signed-off-by: Nicholas Mc Guire > Fixes: commit f3d9478b2ce4 ("[ALSA] snd-aoa: add snd-aoa") > --- > > Problem located by an experimental coccinelle script > > Patch was compiletested with: ppc64_defconfig (implies CONFIG_SND_AOA=m) > > Patch is against 4.18-rc2 (localversion-next is next-20180629) Applied, thanks. Takashi