Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp761714lqh; Thu, 28 Mar 2024 16:05:59 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXLxvMMeL30T8eacQOnhtC9+cMKKScvh+Upfe/XTbpD8tRU29sUMLXe7FfPNMEUbGm2SCOc8MYU6m7ReBSz2VuQKVJl25lPPMVhULBiBw== X-Google-Smtp-Source: AGHT+IHoipuxBuv0Tk2apjF4iKgbVdBiMCg03Vv0Mjd8nv477oozD/p+vzoB0y1aJbW33abLisnx X-Received: by 2002:a17:902:ab97:b0:1e2:a72:8428 with SMTP id f23-20020a170902ab9700b001e20a728428mr846076plr.40.1711667158954; Thu, 28 Mar 2024 16:05:58 -0700 (PDT) Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id h10-20020a170902f70a00b001e0a512e31esi2434445plo.509.2024.03.28.16.05.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 16:05:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-123795-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=ET4LfCM7; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-123795-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123795-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id A1C38295072 for ; Thu, 28 Mar 2024 23:05:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 53E2E54BDE; Thu, 28 Mar 2024 23:05:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ET4LfCM7" Received: from mail-yb1-f181.google.com (mail-yb1-f181.google.com [209.85.219.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E7A094085B for ; Thu, 28 Mar 2024 23:05:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711667136; cv=none; b=sf25+5xrb1w7c6VCqVU0CT/iJwkgoVFQTBL0yNHXzIfIEHGbvI4gKFTq3YSJJp1dyRUQaZFZxx4kVlxUbnEJ3zEYTQopgnE+bmnfNmqH9ksoGcyr3Rp/57SBpXDOBcx1w2+XW8SU8PUPxSc9OgoQSZGqofzRYdTmg45Xbl4ovkM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711667136; c=relaxed/simple; bh=KI7CEFgcmzK5wjsnY/Q5zxt2MYA7bviE7qSKhQfSO2s=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=FycMoDlnuGFmjbO3zYBsfMzrUu2lsktpG4YUdkAfURmtzQRlyf928J2e+RNKB1c1vm9uaEq4pRFv1QR90LtXAxdmCtPF/akH1MPyze3lDzokvU5gG3Nh6HBZnvBuSnQ4mWKz7rumH7D+IojpSsmedzkcyd0FpwM2jHjOOBHFQvA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=ET4LfCM7; arc=none smtp.client-ip=209.85.219.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-yb1-f181.google.com with SMTP id 3f1490d57ef6-dc74e33fe1bso1456392276.0 for ; Thu, 28 Mar 2024 16:05:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711667134; x=1712271934; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=KI7CEFgcmzK5wjsnY/Q5zxt2MYA7bviE7qSKhQfSO2s=; b=ET4LfCM7PHGTO8C0E/rLiu53iWDlfMXeXzG9V/hOpPvxxp+0Z0XQ3/0tqCFJofn/Te zSsesqG2kcN8uwgEg0ic7JNaJrk1BpS+XMNpIEWlm9NqrA0jhEqvlo/osHRpTdh3aHYG s+lUIhXory7aAtpw2oEqm4juzsTjU/8AhUfonmwV7eB+VSRQwxx3ZnNQvzGnXufQ+A1B DibBbdMRAlMaQKiII7XDTGH7uFbitqrBwziLHeNbuw70zionhns0lI3LHqgDmtuZa/tA HGIr3CT9DARLImMHNbOABlX7ka+fp19mmKpYOVHt/VXAv5NElwkzBlS9utbdkQXJxOog /H0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711667134; x=1712271934; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KI7CEFgcmzK5wjsnY/Q5zxt2MYA7bviE7qSKhQfSO2s=; b=GZSYQAWXwIVFO57KA1mwujyz31gvN5O9n4EEAssDcNYvaRlzTXJ3ad0NSSvyxY93KH 7MzWGf0MqII4XeqFl7bnqV3ijqQ1Mf/tiQ/uL7fwK1/yK8+23ZS5QrxO77LGqymOb6Mp s7sWaMYhuJcSc9w5uF9Gf6RL9SotfmG9QKCgmd+mH8Q87rk+lNkoYsCdjQvAw0NwwCJ/ oz28tQfzmxJ8YmKpJWkP6UpQDhMaZzOiEdSblvI/1K7pFD6D1gVTXvLVV4Dhd0WNLdna WP7QUZjFTkeYIh1Bo5DBKg51K7ioBuSCaKCafeEwP4w0K27jCYN9JXRUacd0GI0T8386 1CJw== X-Forwarded-Encrypted: i=1; AJvYcCUhwAC6aPfda0jPUcJ7gK8e5nSa992fy3Xq7jfq0ByjcQ49Wt387HZmbtCAYp7/j/0pWfERVtiTeJdp1tIWOD+mWlKlUMhzcnxTsgKG X-Gm-Message-State: AOJu0YyMyI2QoMK0Zeuz19r0Zfz5HNyGFc7M6ZDAyqmqRmArafH6njaM gXfdCkQJJ26PozdKcOoyvkJxtuLmGMiB0uo9CdfVd8Di0+4YpOWwIrTfX8I2cgLbPCIsr0PE6I6 vbHs+Vd/H14nVT4Mo4AAOwiRdp3zSlDHG1UrDCA== X-Received: by 2002:a25:bf85:0:b0:dd1:40dd:6631 with SMTP id l5-20020a25bf85000000b00dd140dd6631mr813474ybk.3.1711667133862; Thu, 28 Mar 2024 16:05:33 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <578fbe56-44e9-487c-ae95-29b695650f7c@moroto.mountain> In-Reply-To: <578fbe56-44e9-487c-ae95-29b695650f7c@moroto.mountain> From: Linus Walleij Date: Fri, 29 Mar 2024 00:05:22 +0100 Message-ID: Subject: Re: [PATCH] pinctrl: core: delete incorrect free in pinctrl_enable() To: Dan Carpenter Cc: Tony Lindgren , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Peng Fan Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Mar 21, 2024 at 7:38=E2=80=AFAM Dan Carpenter wrote: > The "pctldev" struct is allocated in devm_pinctrl_register_and_init(). > It's a devm_ managed pointer that is freed by devm_pinctrl_dev_release(), > so freeing it in pinctrl_enable() will lead to a double free. > > The devm_pinctrl_dev_release() function frees the pindescs and destroys > the mutex as well. > > Fixes: 6118714275f0 ("pinctrl: core: Fix pinctrl_register_and_init() with= pinctrl_enable()") > Signed-off-by: Dan Carpenter Great find! Patch applied for fixes. Thanks Dan, Linus Walleij