Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2742682lqo; Tue, 14 May 2024 07:58:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUT3wy6MXN7xOG34MS/E7nbevM6pOXeRdzyYuirpJrK8LisS9rBq8A/ujlzNxmeM0YQZ22AS0yMeciCqAqN7ju3sGB15QuqKJjTqnuB7w== X-Google-Smtp-Source: AGHT+IELxWddwk8uxSxtNXbVmRVixfOJRlwnBi3UAafPBg1Hb1XtvnYDTRxMgfboSpbRKgCVaTXv X-Received: by 2002:a05:6a20:7486:b0:1af:8468:5f79 with SMTP id adf61e73a8af0-1afde0d5503mr17753733637.16.1715698711024; Tue, 14 May 2024 07:58:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715698711; cv=pass; d=google.com; s=arc-20160816; b=wwQn9qo9Bdq8+ILwoifVH/K1m9Qf5c/RgpDhAFQWnYbXZj+N9NDqHDePe2CUaeaWe3 O0ZArcBM9TvA2Imkww8PCLitd6uX973zKzPJvssDnSIhe00hO1kVzrJAMtcDpGumVLd4 TtcrMWHF3ebLskUZr3+OR0QuSYhpR3P8iroVm0q1C1nq+U0Th9whKYj/B/tPjssrNSj7 tFCUcVTWryabykhaGhtmebmReVErefkOYeBwwbB1ba2lXFkxBs3g9MvLGeHG8L2RpL8H AnWC2ivFky94jA3F5mSuspTElVM28MPWai7Uku/pquxHVLdwv0gvS8Wuh2GzKMPU7FdM 5xJg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=bwEQjDtclPgsnDIcTAuLdmlMHQyoSIcE6haHefklVTg=; fh=a0Easv1KtTUrVl45KPd3rErXGQ4fCTGETaaAWYuUTxE=; b=qev/G7O6NAbA2dsy02sGfV4Jsz3/0GcbWIWiwNJkc0LCcNc6uCn2ra78QkUf1LTX0f r1VngwuS8hFJdi/4sx+eDH4gtQdwuimoyJ2XMU9mvuhlifvdt2krEm9IKCV3Htno5LYY xSfv5WsP+4hCouZThXaNs50zI+PuMH3eOPHk9x+928l0kKF1g1HCjqOpdmoSKyLwNKpt PlNo04MS1aWXnozjEG74almYYev+Sim6CQBs9s3yhMexWKjf3yEfTktTexbF0D0FkfZS 6o1htQvpRcATiHEKK+B7HdUoATwvrcDrQ5sOnFvRk0P1WlEgkpszOEdPUmhX/IAv8+0B UlDQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=jb1pYVjP; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-178832-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178832-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d2e1a72fcca58-6f4d2b5146esi11983723b3a.390.2024.05.14.07.58.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 07:58:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-178832-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 (test mode) header.i=@ideasonboard.com header.s=mail header.b=jb1pYVjP; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-178832-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178832-linux.lists.archive=gmail.com@vger.kernel.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 63806281E15 for ; Tue, 14 May 2024 14:58:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9048417EB92; Tue, 14 May 2024 14:58:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="jb1pYVjP" Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (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 393B7144D0D; Tue, 14 May 2024 14:58:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715698698; cv=none; b=nx3pL9G4VFjUxTNK0VylWIg+QReQsEKwIDdqX11iN1yqiXAUalItgUUH0zNV8KGdTI/WvtJ2oLJefdqZ62oT4LsSEcDATFj/QhVq3JR6bEMouwDfzZk0ReEbHrVB2gMoKBIjKk9RVCyhAMB6XOTb2C5EbShB83q1dz1LbtaP1Pk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715698698; c=relaxed/simple; bh=wNSTj4hGmGdOckhYdKmd03we4J0ObyzxoIG5cd67V7c=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=k1t0aIRTlBkC+6jbZicNq3qlxuRFVNjvZnl4Cbq8GC98OpGCSi9+MtV2WAJAGSzIEY9ETSyHfuwhqrsfT5M9Ei5sX2Hri0QYPqr+xSesWqrFHpDlmaKIDDso+FuYNQT7x8HH5KOcV5l+5eFR4W1BVia1nQuq2MfrDkLz3hAnGx8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=jb1pYVjP; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E436E22A; Tue, 14 May 2024 16:58:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1715698688; bh=wNSTj4hGmGdOckhYdKmd03we4J0ObyzxoIG5cd67V7c=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jb1pYVjPx0opwTVqVSzahYGKGTNYfJpucPGTQgREbRTROoAaeGj+ZZEDWOaGGqduD 8UdoCQUkK6rRl+tkF5dsjLjWQwFFR0juEkV17e+YqdOsbtaKNevNRdTRHeGtvu+eLX AQENBoUJ7sbclrso/oLXRmtF4FuwvUR/hxsBGW+4= Date: Tue, 14 May 2024 17:58:07 +0300 From: Laurent Pinchart To: Harshit Mogalapalli Cc: Philipp Zabel , Mauro Carvalho Chehab , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Michael Tretter , linux-media@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, dan.carpenter@linaro.org, kernel-janitors@vger.kernel.org, error27@gmail.com Subject: Re: [PATCH v2] media: imx-pxp: fix ERR_PTR dereference in pxp_probe() Message-ID: <20240514145807.GF32013@pendragon.ideasonboard.com> References: <20240514095038.3464191-1-harshit.m.mogalapalli@oracle.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 In-Reply-To: <20240514095038.3464191-1-harshit.m.mogalapalli@oracle.com> Hi Harshit, Thank you for the patch. On Tue, May 14, 2024 at 02:50:38AM -0700, Harshit Mogalapalli wrote: > devm_regmap_init_mmio() can fail, add a check and bail out in case of > error. > > Fixes: 4e5bd3fdbeb3 ("media: imx-pxp: convert to regmap") > Signed-off-by: Harshit Mogalapalli Reviewed-by: Laurent Pinchart > --- > This is based on static analysis and only compile tested. > v1->v2: fix error message, we dont need %d in dev_err_probe() > --- > drivers/media/platform/nxp/imx-pxp.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/media/platform/nxp/imx-pxp.c b/drivers/media/platform/nxp/imx-pxp.c > index e62dc5c1a4ae..e4427e6487fb 100644 > --- a/drivers/media/platform/nxp/imx-pxp.c > +++ b/drivers/media/platform/nxp/imx-pxp.c > @@ -1805,6 +1805,9 @@ static int pxp_probe(struct platform_device *pdev) > return PTR_ERR(mmio); > dev->regmap = devm_regmap_init_mmio(&pdev->dev, mmio, > &pxp_regmap_config); > + if (IS_ERR(dev->regmap)) > + return dev_err_probe(&pdev->dev, PTR_ERR(dev->regmap), > + "Failed to init regmap\n"); > > irq = platform_get_irq(pdev, 0); > if (irq < 0) -- Regards, Laurent Pinchart