Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp1249745lqb; Thu, 18 Apr 2024 04:54:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUQmGiDJz0I0u00s/AhZIDdqa3S50DkIRJPHNP5ZvdsR4TVD4idmg2zJ4mOj8NczOYBz7bR5quTLGWx0w8T6FzJW1GohDIgWkNhLkyrqg== X-Google-Smtp-Source: AGHT+IEXMb+SA4GwN1x9WuD1grYVv7kGLmzqNz/z6fcRycU8DiArWsh9lMRcWUttx4OPXG/1Mb/9 X-Received: by 2002:ae9:c119:0:b0:78d:32d3:8a52 with SMTP id z25-20020ae9c119000000b0078d32d38a52mr2964830qki.22.1713441266725; Thu, 18 Apr 2024 04:54:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713441266; cv=pass; d=google.com; s=arc-20160816; b=EKQpdoVSU6X7s/TNKQD7T3hMlg/i9IdOQQOy99vAAde1pMuWFTnLZe0a/e+5zubFuJ xOsvjq6qL/xZT8SNUBEckd67GglAoiqO1jqjVUqeAcvq/adw6OBNR5iLB5FmgF75cy8Z SOU/Pq5GGTFaPD9uH3LKF5SenufMB3t+BbFcR4fcBThYc3gs60eAPgnEdt45gb28axoX ZHtvXdeSKEKiGm9dhAqghVGW3/O4fnZY+S5UQNhlfVWTWOeNBiootmSTZSE2fWl3kX2o QZXzQ7BC49txWXZ6Pd9snE8w83wS8EpWMKgSpW8yoHiM2W9qUF5mHmAZ/+bOyAmOmUkh lxAw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=CG4gMAT/u+dqzVOE7SFDWH6+kKzOmYoWtiKUTwuXNGM=; fh=PF7/AMFeYDwU+1IElrKRKEn6ctqZGFywA1/vhQUWDTk=; b=nfe/LAIJzkrtV92Xq1Sr2InYynjaY46B0pKgRETsEvltcdP1BMyRmq/+jiHted9okm fzu6F3y4jApReVv4or85fPJFlvVjn+Q9yn/mWwPFwyqkBykSAKR4IXXEu/YFVqGgjrpn kh3FPa9+/atu7uVx6986iNmIBVRW/P03+RQ6tIaVNKMbmuFcLEl1WTsabJDXnRFqG2lX sY5npR1RDxDNxZRgkMIKcXtQWYKusPBbAju7wFDcrGqxEgJWK3nL2D5zn8NO4fxepGWC bQgHSyiBSu4pi2/Dvzsrm0sEhz/htH5Q05/ef8QQCxYq23coEzQ2QP+KYDIwA2PEgKa4 i/YA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-150015-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150015-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id x14-20020a05620a448e00b0078d5f25477dsi717393qkp.446.2024.04.18.04.54.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 04:54:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-150015-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-150015-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150015-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 5DE2A1C22011 for ; Thu, 18 Apr 2024 11:54:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D8B7B15EFD3; Thu, 18 Apr 2024 11:54:19 +0000 (UTC) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D901015E7FA; Thu, 18 Apr 2024 11:54:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.187 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713441259; cv=none; b=f8Fp4Bb1yTQ3aOAhdE9e+bro9zEKDCPBu7mZf8kGA/5gdprVjbm0cC1aR45IJr2hu8yNoZCD0P0BTeiKUL1I0gIMUkZFM7JnKnNZ0rzF+fyXXH6N4XsN5I1OBEWXZNmdRZkr5reD3H44C4xuTxpelJl73nlleCuG6WKwhfuXA+0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713441259; c=relaxed/simple; bh=CG4gMAT/u+dqzVOE7SFDWH6+kKzOmYoWtiKUTwuXNGM=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=Xtd0QMW5aD3Sn4OOyxeRn1XzUeC6nB0Uzg6qYHULoFAEGVDbNzuFcL59fHyU+XLnlpfG88q3r2RiIlYAzA/n9lUPh24/qQ72DKsvFNHIidn1Na1gdr2O5RJ2IY+5FHUpUa2yaPrqRfsu+kepXoZpU/Tppxle7cXg5np3q5ewfhk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4VKx1m0VDDzwSdL; Thu, 18 Apr 2024 19:51:08 +0800 (CST) Received: from kwepemi500024.china.huawei.com (unknown [7.221.188.100]) by mail.maildlp.com (Postfix) with ESMTPS id 4C358180080; Thu, 18 Apr 2024 19:54:12 +0800 (CST) Received: from [10.174.179.163] (10.174.179.163) by kwepemi500024.china.huawei.com (7.221.188.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Thu, 18 Apr 2024 19:54:11 +0800 Message-ID: <442a67cb-8f1c-f6ac-98c1-ef97db52d5a2@huawei.com> Date: Thu, 18 Apr 2024 19:54:10 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH v2] pinctrl: devicetree: fix refcount leak in pinctrl_dt_to_map() Content-Language: en-US To: Andy Shevchenko CC: , , , , References: <20240418113459.4182749-1-zengheng4@huawei.com> From: Zeng Heng In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemi500024.china.huawei.com (7.221.188.100) 在 2024/4/18 19:41, Andy Shevchenko 写道: > On Thu, Apr 18, 2024 at 07:34:59PM +0800, Zeng Heng wrote: >> If we fail to allocate propname buffer, we need to drop the reference >> count we just took, otherwise it will lead reference leak. Here the >> error exit path is modified to jump to the err label and call >> pinctrl_dt_free_maps() which would drop the counter. >> >> In the meantime, if it is found that the property 'pinctrl-0' is not >> present, ENODEV is returned and also jump to the err label and call the >> free function, in case the Smatch tool complains. >> --- > You forgot a changelog, but I think this needs to be a followup. Oops, the resend patch would come soon. Thanks, Zeng Heng