Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3157472yba; Tue, 16 Apr 2019 06:03:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqzY85VqAEQaHmpBPjm/6fiunqT5N1oLpJaSV2v7J02cxFAMpQmhoACIt4QOkDuzgNqmoSQR X-Received: by 2002:a17:902:167:: with SMTP id 94mr53333442plb.108.1555419790179; Tue, 16 Apr 2019 06:03:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555419790; cv=none; d=google.com; s=arc-20160816; b=XFkYChaKOIkVHGNq6/BP2j2XdJZeAjqW/ZG4MVMOd8UuBLV9te9WDjoFMiMTECTscB tDt8NPguc6SXSCBEtIMkPkqvHJDiM6hr6qpy/qSle0OJiMP8arsH6AdtAXVBLkyDI0B/ cVB741tcTqoaQ0krZwkZlRjcpxb39hlUMCK7O4JXazcuUuyxEU/0Krx8u0WsTt3HzsBP W274g1wuk2QX8qZQnvXACOXibciBHezg3HxKyZvINBzRuLd5E3XVE5BMbDcpcANxDExM QvOqkbu65vphibi8m88LwhsgSuprn/HfP8VoPrsI5OJoP/rojvJsHBdfSIrwdM6JdZ+D XjKg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=XBZTau86szfxIUaEBeAXo6xpm1JznvlXiIYSF35lflY=; b=OU1HatmeV4cRYDDcJW8DOY0TnxEuuDh8Mmd/CYYizArbgX28jc92lvGLDTUjJwJpiX x8f9e1pzodPirB3m8iQYH/IOYJRsQLELGCihsmEBtXAuuJVVrCoL5XpGslSDrrd9ABQn udRIwnkL+KjT/h3LRPv38HApQXNPOR3f8dc6PoPMM1t1YaiTlzVV6czSJ8roNAzKnog0 qazipsvhF+0y3N8LbZ15xlzqjkX8KlEy2PjPBzDXFPe5KTtsRq/Al3AL3WGnilsvc7M0 x3uxHwh5MQ2n8NLhTYttdnOKScQHJq4u+DR4UgmYsvVTcCuJj93BbSNVJevXLv3ZLGty MNWQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 44si33554395plc.134.2019.04.16.06.02.52; Tue, 16 Apr 2019 06:03:10 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728650AbfDPNCE (ORCPT + 99 others); Tue, 16 Apr 2019 09:02:04 -0400 Received: from foss.arm.com ([217.140.101.70]:54588 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726796AbfDPNCE (ORCPT ); Tue, 16 Apr 2019 09:02:04 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 907E1EBD; Tue, 16 Apr 2019 06:02:03 -0700 (PDT) Received: from [10.1.196.75] (e110467-lin.cambridge.arm.com [10.1.196.75]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9F8C73F706; Tue, 16 Apr 2019 06:02:02 -0700 (PDT) Subject: Re: [PATCH 01/12] arm-cci: add missing of_node_put after of_device_is_available To: Markus Elfring , Julia Lawall , linux@arm.linux.org.uk Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org References: <1550928043-14889-2-git-send-email-Julia.Lawall@lip6.fr> <2c56bdcb-9354-c719-13df-38b5f1974f10@web.de> From: Robin Murphy Message-ID: Date: Tue, 16 Apr 2019 14:02:01 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <2c56bdcb-9354-c719-13df-38b5f1974f10@web.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14/04/2019 15:45, Markus Elfring wrote: >> @@ -538,8 +538,10 @@ static int cci_probe(void) >> struct resource res; >> >> np = of_find_matching_node(NULL, arm_cci_matches); >> - if (!of_device_is_available(np)) >> + if (!of_device_is_available(np)) { >> + of_node_put(np); >> return -ENODEV; >> + } >> >> ret = of_address_to_resource(np, 0, &res); >> if (!ret) { > > How do you think about to move this function call to an additional jump target > for the desired exception handling? TBH it looks like the whole thing could do with a bit of refactoring - strictly we should probably be dropping the node reference in all the other failure paths too. Robin.