Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1994397lqg; Mon, 4 Mar 2024 09:34:43 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVURmC+2QYkMLEKRk1eQVfRE5goF3WY6DVoR90hWglBEDU3WxFieZbRKm229WhlKQmMrYTanmbNqkiDRlPNXqNYjOHa3sfzOQ0YRCfNTg== X-Google-Smtp-Source: AGHT+IFCwJ8GnO0Sj5DmVcG9K73Pchj0pq0biECXtHbG0JftvPpx/5IiX257a3WYtYBHmwPszLni X-Received: by 2002:a05:6a20:a10f:b0:1a1:4b3d:2e5a with SMTP id q15-20020a056a20a10f00b001a14b3d2e5amr6811410pzk.17.1709573682861; Mon, 04 Mar 2024 09:34:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709573682; cv=pass; d=google.com; s=arc-20160816; b=FyDxyRaImKE0u7Lm2Gx8ajtdqa/aKdaw3152IiXfVzZ1hXnSCC/be77ZUF6ULp9H0w 7jI/UA8tQ/rqlmCddyjKsH1hhAyJc4aXzgO24km4SOT0PLPyiQdLruNeeVBUwQnE2qbF zhxAy/u9nBd9rmpGG1ofsn5jn1oM6zAhXZlLNROWmuceVZkH5x2bV0RFN6qdz6kqV4Ac mqP7fpv6mJ+xfFNQTiIs20fx2v5WqNcijTQUwUFHcxzT4ZXB9G3G30QgoGEwV9trqXYj psIa6mXNp2QlsZACrBRZaFm6OVJVb7oXtkgzvx0phU68pYR4uCI6qSbFM8PQFSvqpXjy NUeg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=UmgdeD3y5bH8MTO7d9mjBfyE5hjIg3x+2bIjgp9F6A8=; fh=h1ZZei7ycFXeqJQSFkYU1UBu6m34o42CMRRWUOvycbc=; b=sdaAPnWSb4ERVBMKhr0TmJGiRE41bhrWSPR3QCAhR7ypARJWFryhobwa5HClpYGDVQ ZBKVkgZIVw7Onjia0tlUevSJjWJujspTZ19L9LU4iGYvSEXyeE8poYWgsTliAjhM4Fr1 J50IwsIUVImNkHL5cny6Lmv5rh7XJBDSYz2Dg+yF2+dZrbkwxiP0nvmaZTJTPgajyRqK mRBU0DatMp+EBSmpYEW7yE/XdFIV0F7Q+JM2XkoOAZsIyjiUSetNKnYzv79qqfJ9eW3S vncK9yq2hfqZgovVfokfYXRgDAzn5yTdQIFqGMn0A258KNuqfCUP61NUrgbyeSx+/2QV jkqg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=KVJbzvVt; arc=pass (i=1 spf=pass spfdomain=opensource.cirrus.com dkim=pass dkdomain=cirrus.com dmarc=pass fromdomain=opensource.cirrus.com); spf=pass (google.com: domain of linux-kernel+bounces-91005-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91005-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id ln21-20020a056a003cd500b006e58332ed1esi2253140pfb.358.2024.03.04.09.34.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 09:34:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-91005-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=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=KVJbzvVt; arc=pass (i=1 spf=pass spfdomain=opensource.cirrus.com dkim=pass dkdomain=cirrus.com dmarc=pass fromdomain=opensource.cirrus.com); spf=pass (google.com: domain of linux-kernel+bounces-91005-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91005-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 50110282217 for ; Mon, 4 Mar 2024 17:34:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6FDCF612EA; Mon, 4 Mar 2024 17:34:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="KVJbzvVt" Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) (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 073D81E484; Mon, 4 Mar 2024 17:34:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.149.25 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709573674; cv=none; b=g9nrit9xTfD6gMxEWXAP69QhC9LABi9E2PSM4cyBhCIGSbMKgpTYSenO9UUBGojQGUGJDfnTISdOTYos5wWgfAKD3Ltc7zzpry+r6PT1tA9yfV6yQQO8gbhpk2HwDpUFBaErjZMrhtRfKJZQWZlERsD3fzDt/E752k40DfOxt8o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709573674; c=relaxed/simple; bh=TUFC2oXSkwh1q+EPlqWlIYwORwjSCpCR0ZK+J1sWVDg=; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ckVAg4+MUeQnDADjgfGBurcyj7sCG7zDQHeWnWV15N+x03gSx3Wd+jeOlYBuDEJb5aECeJLgwq005Qyb7L61gsqKZ4+NyXPZNkU8yj/EdXfQENMIpaQmKwP9F6NyPhpgveeI5ElPxFtLslMFgg14Yg4mRlTbf4Bv2KSp4vh6Q64= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com; spf=pass smtp.mailfrom=opensource.cirrus.com; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b=KVJbzvVt; arc=none smtp.client-ip=67.231.149.25 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=opensource.cirrus.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=opensource.cirrus.com Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 424H03rG023294; Mon, 4 Mar 2024 11:08:58 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:content-transfer-encoding:in-reply-to; s= PODMain02222019; bh=UmgdeD3y5bH8MTO7d9mjBfyE5hjIg3x+2bIjgp9F6A8=; b= KVJbzvVtmtnT9Mz7C9idMb6aC/rJgH7jReMf23cfoKrPMhio0HJbfUcSlLc3c35o 16hGfV3YAurNHMZ5mCzS3kc7vt45xkDMs+TtQm2RmKPNFZSoAf3XqhcyT6+HtmVc bGMeF2e+9OphoBDETNJOsMjTmvP6JXoJI8KxUg5T8ylZ2NCD/APavn1X3Icdy2oY EiQ/phA0mtqdA/nHzMXHa7IKUiIPtQtXP3gKlNlXunYlwB1akH/r6FE9sU6tKhN2 It2olIOVuh+XmUq2LcCCG+tthL9DL/6UfAc03lUdhYNvcjZHKwCA86rHC6uAtMm3 Ch1+utbxVgn5UGNEWgEljQ== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3wm2d2j4uw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 04 Mar 2024 11:08:57 -0600 (CST) Received: from ediex02.ad.cirrus.com (198.61.84.81) by ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 4 Mar 2024 17:08:55 +0000 Received: from ediswmail9.ad.cirrus.com (198.61.86.93) by anon-ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 4 Mar 2024 17:08:55 +0000 Received: from ediswmail9.ad.cirrus.com (ediswmail9.ad.cirrus.com [198.61.86.93]) by ediswmail9.ad.cirrus.com (Postfix) with ESMTPS id B6E48820241; Mon, 4 Mar 2024 17:08:55 +0000 (UTC) Date: Mon, 4 Mar 2024 17:08:54 +0000 From: Charles Keepax To: Bartosz Golaszewski CC: , , , Subject: Re: [PATCH] gpio: swnode: Don't use __free() on result of swnode_get_gpio_device() Message-ID: References: <20240304160320.1054811-1-ckeepax@opensource.cirrus.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Proofpoint-ORIG-GUID: o8tyN_KVLbO71e-kPl2lMRBj3NUNHT8H X-Proofpoint-GUID: o8tyN_KVLbO71e-kPl2lMRBj3NUNHT8H X-Proofpoint-Spam-Reason: safe On Mon, Mar 04, 2024 at 05:34:27PM +0100, Bartosz Golaszewski wrote: > On Mon, Mar 4, 2024 at 5:03 PM Charles Keepax > wrote: > > > > swnode_get_gpio_device() can return an error pointer, however > > gpio_device_put() is not able to accept error values. Thus using > > __free() will result in dereferencing an invalid pointer. > > > > Can you post the steps to reproduce this? Because it should work[1]. Hmm... yeah that does look like it should work, I have had the patch sitting in my tree for a little while, let me double check and I will come back/resend if it is actually still needed. Thanks, Charles