Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp677908ybb; Thu, 28 Mar 2019 10:01:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqw5k6F9w5COSzkb5wHw92MeoPYyjD84I+p7yIpKQv7KQ2q6EWMuFhSKJ30yxxlHnyGoboJd X-Received: by 2002:a17:902:2888:: with SMTP id f8mr44657230plb.244.1553792476932; Thu, 28 Mar 2019 10:01:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553792476; cv=none; d=google.com; s=arc-20160816; b=v9cyrFVrT3sKRKI85+2Fudb/zu8Xg95fjxSdt3mN94rmciFh+bPNCCoX283iNHogMO GTjOk26Or+FTELrXhsznjslsRz3mob4AB1kTLacU/zi8vC/OgGjZAwZMPbqG7vwcW+Bp 52risn3IQScfK+6licPBCwV3XEYxARPBatvl1+vQ0nQMjArvX1B7VYSIN0quD1n6VKVn Ob/Xtp8LlajGRNxuEinKecDOa+H+S9rK+S4mG7L7g9AA+68D9jb5JP7zI+6g60GkMNr1 ti9B4GbTp55OGmkiX1RezltOOPZav8DVPSA8MOifXTB3GmWVr/+TR9Co3zoWezx9Dvxx WiHw== 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=o/+W0P06r1ff8sv+FbAjmdA7UJFrLZb33lSPw5SxP4g=; b=wW5lPilmj9dMv3v8VxHAZUujO2tfCveeSuD72LWLQv3xtXZSjLdtiLz04zs8CKiyPW YZNUl4cLkktJ9O4UsmkbP81tKRNC0bP7gX+xql+rkfui9tWwaNGV8hUGWCOvc0RGE585 Qng4LVAAw99tQNyH/OSILc5G47+rjEAheZJiveuqE9xP2qTP2N50xSK75F90Hd9OkVEc Ty7tOMowzyCeiqsY32SjKUhffk/Z2+0hnDeOlovM4aHWgMGhUtJrPJEpCf2mH8J/RjRZ pjbUTty6zWzb6QyrboEOevTJ6BGyGvt7e1ZwmVUC8kUqpUBI5FhZsyUZSGnxLV3U61pQ Cebg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UuiWoi1s; 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 g132si21789383pfc.240.2019.03.28.10.01.00; Thu, 28 Mar 2019 10:01:16 -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; dkim=pass header.i=@linaro.org header.s=google header.b=UuiWoi1s; 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 S1727072AbfC1Q6z (ORCPT + 99 others); Thu, 28 Mar 2019 12:58:55 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:33127 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726287AbfC1Q6z (ORCPT ); Thu, 28 Mar 2019 12:58:55 -0400 Received: by mail-lj1-f196.google.com with SMTP id f23so18339821ljc.0 for ; Thu, 28 Mar 2019 09:58:54 -0700 (PDT) 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=o/+W0P06r1ff8sv+FbAjmdA7UJFrLZb33lSPw5SxP4g=; b=UuiWoi1s/L5/cyb01/8JLu1dY0rcWmeHpaQy1bC3k3mN6X9Oe/TbQt2tHv/P92T+uO 3AtV2Kfi/WBqLWbDiOL5SM50AN18SK0BDkkC2qzeJN7w1YTfRImlcwuIjJH7cIuGhgH/ DLT3dYL23vriwWvZ1u5EzgtTKuqLdCxaZCALD2bN+JOKimMcxwN4k68mWMjq1lt8zhHJ Mw85YgfPcqBwMxu6OwzgTboUCBf3WWKSNcSbcDHQbi8mtBvV/Ku7XnvTvjIrdFTBhZeK HVqamBTsIKcabdR1m75FUl2l2uCOdw1vkPktIMMv8wq45v3ZL6SUrWVCZfCeFZUAI5+q dkpA== 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=o/+W0P06r1ff8sv+FbAjmdA7UJFrLZb33lSPw5SxP4g=; b=fXIOyYVIwgzV6HXw+Wi2GMqCvab80y/+YyhAq6pe9yz+MYvcoF2lvDfcEoluIpMREK UqyYNBC4FeQwJl0vk87xo91Z6x6p/UTZSN/QY8Vks2lKMShY2qUS1wwDC5A2rYvKvkQv +dfCjVcX9QwcmMZmH5TQIJIHFdygZg7Aq9OjVYWvzzPK2tCcP6rE8yS1C9gDuVKBVUMh bH//1zQXJ+xsCDnfpmoaSTl2HEJMwKRzZ0bBo+JItjRbChgqomRosraWkYYAfj3a8MUx Nh3IKfP6hRb8c8j+gUx8Q7NKliSkFEdyOv+Xa2jqZOXdAl3POxBn2KplYagzMG8nauP0 DQmw== X-Gm-Message-State: APjAAAWREQXGUXD1jcgaKaIkqqHqU1D2nOGEnr7iBcu5JUW6n6RR51/l b+86kDqdEYuKDUGmST2siLjwtw1hq9k5yC8VN06ZpQ== X-Received: by 2002:a2e:7d19:: with SMTP id y25mr9423324ljc.126.1553792333782; Thu, 28 Mar 2019 09:58:53 -0700 (PDT) MIME-Version: 1.0 References: <20190328131349.18838-1-geert+renesas@glider.be> <20190328131349.18838-2-geert+renesas@glider.be> In-Reply-To: <20190328131349.18838-2-geert+renesas@glider.be> From: Linus Walleij Date: Thu, 28 Mar 2019 17:58:28 +0100 Message-ID: Subject: Re: [PATCH 1/3] gpio: of: Fix of_gpiochip_add() error path To: Geert Uytterhoeven Cc: Bartosz Golaszewski , Benoit Parrot , Laxman Dewangan , Tomeu Vizoso , "open list:GPIO SUBSYSTEM" , "linux-kernel@vger.kernel.org" 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 Thu, Mar 28, 2019 at 2:13 PM Geert Uytterhoeven wrote: > If the call to of_gpiochip_scan_gpios() in of_gpiochip_add() fails, no > error handling is performed. This lead to the need of callers to call > of_gpiochip_remove() on failure, which causes "BAD of_node_put() on ..." > if the failure happened before the call to of_node_get(). > > Fix this by adding proper error handling. > > Note that calling gpiochip_remove_pin_ranges() multiple times causes no > harm: subsequent calls are a no-op. > > Fixes: dfbd379ba9b7431e ("gpio: of: Return error if gpio hog configuration failed") > Signed-off-by: Geert Uytterhoeven Patch applied. Yours, Linus Walleij