Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp595831ybv; Thu, 20 Feb 2020 04:06:20 -0800 (PST) X-Google-Smtp-Source: APXvYqy9YR2DhwBgvXbePmCySX+2fpyIkUfy9uLJ/+ZIbmqBhApQqdni4XxUj2402M9kbtSMlxMg X-Received: by 2002:a9d:5d09:: with SMTP id b9mr22801385oti.207.1582200380700; Thu, 20 Feb 2020 04:06:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582200380; cv=none; d=google.com; s=arc-20160816; b=z27h7D2appRUcMBngW5mDH3+fk6j7lrE7PNfgWM/u7X8OAbXL8jTbvGfS6NUJV9BcH LIv9dZhrmIxMIpmm+P/w2KteHRqryUFEw+CGQVwuhd1d7eIPcamidz72czdS4xQtUhOA XTUXU7vk4DGQJ65Xg5m/pbo9+nRXgomH0DiRPODc6OxSUnLb1TcQpu2s5hdLtQjw/cNE Ed/GRARnfzOtKLO51e8zYn9wv/KstrrZbqImK6QajcU1MTyfZjkSTwxtGnULel0/UvSN 5UWk1YQlpMKetBoKA/jAjgNPMrhoAOWvb17BIvOHW/+MDhwEd+riZ+zhojpugHlI0T24 0QOA== 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:dkim-signature; bh=Z0vvlPPE+vtUh7ARyCdvaIb9a1HOM3y7M504uXCh/wc=; b=w3J0wPDdOWymTMzgvxkV+acQhXu9NH1H+HJKg8HiWyCRe0eFx9+O0avzqD5mHlvF0t Sl0wPcqlh6ssMhTksfA3fxl0E0x/sC3QfRjk5wTLlkQmtFMOJsTw+4URGP260yEseMYk OjN+oX+QC0ONs6OPeexNt3ZG9ZRoHpVeuYZ1YWmvP3IOiKYpuGUIOQCbjC1RWgDHxr5Q xQR+S+RJ94S/GM1PII1mb6tsaECM388tpBuE1auWioqTbfEdIIllaWvJdZtq7BXt8YNX 1Dyzh6AT6Nvx0zN8Dt07LfJcLbJVV0cgruR5gHws3nkkRE0CnYnORL0AHHfrrDyG+w38 mOiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=x63miHRi; 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 q124si11694438oig.228.2020.02.20.04.06.01; Thu, 20 Feb 2020 04:06:20 -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=x63miHRi; 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 S1727709AbgBTMFv (ORCPT + 99 others); Thu, 20 Feb 2020 07:05:51 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:44194 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727298AbgBTMFv (ORCPT ); Thu, 20 Feb 2020 07:05:51 -0500 Received: by mail-wr1-f68.google.com with SMTP id m16so4295256wrx.11 for ; Thu, 20 Feb 2020 04:05:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Z0vvlPPE+vtUh7ARyCdvaIb9a1HOM3y7M504uXCh/wc=; b=x63miHRikl8gYWEUkXxSkAwph1c9LntSaX7SnxaRAWsno52GtGklGstN18OM8xPQWs lYueTvr3Dzz87f+dW2+FqRwnFFLzFc+wqP3wSr0rzhThXZBqshbtHsgKCAvZIQ05ok/n 6IjcQbtM2uCd9/nBUu/v1DHfGLIpjgb7l8cZi5BgzU6NXF+ZNuzIGdfHImVXm3Ud1LXN mAaqjrKFx7tpIUieP0R5STbF/SlwocIr9iBl5pNdBLEFZPDH7Z/FsJssZmVBBQlEy0Ob eKJKhWEFYR8GLgB4LPkBeYNQIT+tDsbXY/90sel+i3OWViAIZm+IGCDsiyV4AJy+bsvx 3Yyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Z0vvlPPE+vtUh7ARyCdvaIb9a1HOM3y7M504uXCh/wc=; b=lSrJwfjg2OQobVXSr38VBYlNj4Ly9ZdaLovv6vkNA7dcCpWF4gTHJKn1ztml2dv0Yk 9GnLk76PoZTBw/wKMldc6BROo0EDecpVW78TDrYES0rXdVrgmGm+5mQXFT3ht1m9A/Dk /JFPtR4DbPV4xV3ST/s7fDp3o9dEYfyiIpH40u9Ydt3Zy5o9U5FzQb0hPpCxf3avK2SD 4d8QCu13DMD4Ogn1aMetiB68FUOJxTK1TCCputujHp8q5O6cY1baqbVa/T43dZV+83xr v1m2v0UlYkqj73ju+1vO8SFm87MmL95EX3OJTK8olCK8JsWrn61BwhKyaa/udoLYJEe1 iW7Q== X-Gm-Message-State: APjAAAU45wI1QlmjZjzNlCCS3gpQO8WRlzEzZXJ5GZzS+0TStHwpmsgD O3xFbkz4LkRP8ineubBMCRxX0HdIyVo= X-Received: by 2002:adf:ec0d:: with SMTP id x13mr41779387wrn.400.1582200350410; Thu, 20 Feb 2020 04:05:50 -0800 (PST) Received: from [192.168.86.34] (cpc89974-aztw32-2-0-cust43.18-1.cable.virginm.net. [86.30.250.44]) by smtp.googlemail.com with ESMTPSA id v16sm4084878wml.11.2020.02.20.04.05.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Feb 2020 04:05:49 -0800 (PST) Subject: Re: [PATCH v4 2/4] gpiolib: use kref in gpio_desc To: Bartosz Golaszewski , Linus Walleij , Khouloud Touil , Geert Uytterhoeven Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski References: <20200220100141.5905-1-brgl@bgdev.pl> <20200220100141.5905-3-brgl@bgdev.pl> From: Srinivas Kandagatla Message-ID: <5970b17a-b29b-154f-033e-6da007d6a289@linaro.org> Date: Thu, 20 Feb 2020 12:05:48 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20200220100141.5905-3-brgl@bgdev.pl> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20/02/2020 10:01, Bartosz Golaszewski wrote: > --- a/drivers/gpio/gpiolib.c > +++ b/drivers/gpio/gpiolib.c > @@ -2798,6 +2798,8 @@ static int gpiod_request_commit(struct gpio_desc *desc, const char *label) > goto done; > } > > + kref_init(&desc->ref); > + Should we not decrement refcount on the error path of this function? --srini > if (chip->request) { > /* chip->request may sleep */ > spin_unlock_irqrestore(&gpio_lock, flags); > @@ -2933,6 +2935,13 @@ void gpiod_free(struct gpio_desc *desc) > } > }