From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (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 292341E260C for ; Thu, 28 May 2026 10:01:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779962495; cv=none; b=BhV/XzT2Ko6m/vldj978y2ndVgEypjFmsiuIU64CYWMm+EH5ixrmzg7cPzoWcSdPyRwCHGMiNmtHNvWlZQvaArzLavNmMmK1+ULPQeglO4fTQMwkgsSXzXZJBmpj/o/SOt8ytb0E/2X3b9DUFeKTzgJ+VyvO/aOcYVcQ3EtzZbg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779962495; c=relaxed/simple; bh=k0N8p7KR0KzYUnXDsGjczC4xqjOSgzs0rNd7EZRHBsA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=M1fNu8Q5/8nm0FBpnygvQDPdqKpzMc3xHveIGJaVOUCypEuzR5cXiRS4gbx48TEKaftsyOiVnkgX+i4lv7wp8ZZB/ZNTz/f78MXENZWu4XtbHTc2QV0mwa3A3GzPD0vBJGyUCqHuXmivam0diPZNzMx09l5Aqwc/1sYA/xsYRWU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=VCY5viqS; arc=none smtp.client-ip=209.85.128.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VCY5viqS" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-49048e043e5so49123375e9.1 for ; Thu, 28 May 2026 03:01:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779962492; x=1780567292; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=xKY9XqxsUJtupqvz5jn/1XVAIf4nDjsIGBJCahQiZy4=; b=VCY5viqSL7EbuSDJsOh7zR1NcVuBaNNCuNdLOYYk6t7+8DGYy8JtKRPcpM7GVsvADm t1TyvVtQPvycB6itrYROjerZvGeog3g4eG5pzzjOaUrOarX5vllkkaiamtQdHGZj2ZJ9 E+7B2KOGX4B8WQ1pSWXKna4CiedIRz2uGGXPmPkaKbGyWuYCK/6QsrpCa2yTFx38+s6J xzl6dq8f2IunHA92plJBmPOalcRPtOFLAfFSoluy/rQ35bZQAjr1fqK/7QILxc0KO/gA S+iBw6WJ1ob3y5Kmu883dSe69rOchhhmN0RRwm8IOe0CZ0eXFn7p+alsCHr1MFbxlWSg pWyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779962492; x=1780567292; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xKY9XqxsUJtupqvz5jn/1XVAIf4nDjsIGBJCahQiZy4=; b=jgm8Tz6uEERbGTGhCzGyjOmG9pf1kNfn4ItZ++mkubdqCLNxT6OAZtK6ZZ6/0YbfJt WuAkSedIweV7rQUvni5Z0ISFFphRIQVjnbJrwJ8cK+s+DxJcOwUYA2HQs4yYuPi7dYRt gVM8hwUSW+KzDS/68uSihGQksXDpKo+NItoMU4QSadCQ+P4WVvoOAe4YDexg1NmJe9LH J6kCOrElW0KZqPhrw4iFr5+HNLwHmrscv9LxTrGifKdg8py++/LQjL358C8eEBalPQn9 K7plqDidqY/+8+wAdhSZUyCe9JJDFrNoCjw+UfBxPvxBRE5PTnGVEw81m6kc9pkS1aAR pxTQ== X-Gm-Message-State: AOJu0YwQ2tEBwNdAi+A0ZEuuI0PrPwaW+4wJHs40N5rnmhv1kUmrDRe4 Fb9KUcgl44qHe+ztICEfg17QKufu03TfmKd5N5vCuunnXzFs2RZhYYu1 X-Gm-Gg: Acq92OGEvF8d8GLFHkmeXvk0/RMIh4ysGkL/q+bTiapf0O4Wpn7h+Q0Ytd1zpEZLXUV dceKjawnOdMFzZcGH/SK1/vykliekMTSs+thhey7ol0qu6tmUHhOfpl8I02wsL2C/fh4daH5Pa9 hVtFXMF9l73quRQvpHwc8Y1KSIDk4CuGSdZ8WGtoflUnZwMnVQmYEOT1XOuhn19DlOY5luKJWga CSl/d3cm5KSYW5TAAEuZ0TsuDb+jV77PbRPgZ93wwZjvYJN/ElnsZDQ+XYpyH573CSmgW98TGht tfJkJaYXg2Q+qnWMliQsS44Uy00fDHUa8JO5ZPlr2SfNNSFfpu1boduHzXaEJuq+24KXG4CbQog 8u0J3tOZqB0M2rmghEiPqeKRr4NH1zUQNn88/L3gUYp/6naPuI69dWplEQrLGM3uMXKNDsO8uxw hGB6d/nh1FMcjzJxIvIz2K3ueu6Ugsd0eH+Q== X-Received: by 2002:a05:600c:8b77:b0:490:5368:743 with SMTP id 5b1f17b1804b1-49053680a94mr402588955e9.32.1779962492224; Thu, 28 May 2026 03:01:32 -0700 (PDT) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4909235d43esm50997985e9.1.2026.05.28.03.01.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 May 2026 03:01:30 -0700 (PDT) Date: Thu, 28 May 2026 13:01:26 +0300 From: Dan Carpenter To: Pankaj Gupta Cc: linux-kernel@vger.kernel.org, imx@lists.linux.dev, frank.li@nxp.com Subject: Re: [PATCH -next] firmware: imx: Add missing return in error path to prevent use-after-free. Message-ID: References: <20260528091446.3331006-1-pankaj.gupta@nxp.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=us-ascii Content-Disposition: inline In-Reply-To: <20260528091446.3331006-1-pankaj.gupta@nxp.com> On Thu, May 28, 2026 at 02:44:46PM +0530, Pankaj Gupta wrote: > After freeing dev_ctx and setting *new_dev_ctx to NULL, the function > continues execution and dereferences dev_ctx, leading to a potential > use-after-free. Return immediately to avoid accessing freed memory. > > This appears to have been lost during merge of the original fix. > > Fixes: 3ae9dcce8400 ("firmware: drivers: imx: adds miscdev") > Signed-off-by: Dan Carpenter > Signed-off-by: Pankaj Gupta I try not to be a whiner about patch attibution to me because I feel like I get enough credit for stuff and don't need to complain about small things. But it's puzzling to see my Signed-off-by here and normally someone would ask about it. I did write a patch for this but you have modified the commit message and added a blank line. https://lore.kernel.org/all/agv_jhP-2CNTfQXk@stanley.mountain/ Potentially, you already had written this patch by the time I sent mine because it was a static checker fix and a lot of people run static checkers. Normally these tags are in chronoligical order and a Signed-off-by would mean I handled the patch. It doesn't make sense for me to be the first person to handle the patch if I didn't write it. I suspect what happened is that actually I should get authorship credit but when you modified the patch, the authorship was lost. (I have done this mistake unintentionally before. More than once). To give authorship credit, the first line in the body of the email would be: From: Dan Carpenter But if you already had a patch written then just give me a Reported-by tag instead. Either way is fine. Sorry again, for being a bit nit picky on this... regards, dan carpenter