From patchwork Wed May 8 12:31:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 13658667 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 22135C19F4F for ; Wed, 8 May 2024 12:31:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=kS8AHaHoUQHdMOhxxbCGqoU1AC5J8uhq51b9j1Qkkqw=; b=PbtY0nMHH+UR1i pUbff49YVpZFb9BGDu5czwzufU6HSRo+BO8Ixkc1zt43XKQB4w1Uf7ZEAKUTwip/yDgAEkZz2QzFE d+q7x6KVvAN1S26NU16VCdmVe5XrOdD/x6n+pPrPiCZHrvoe+9jt+Nx94/zRjF0W5OUIunEfDdfUh iXC1lyKMZEw6JQ1TmWxCSeHoEK/QbCuHBBqTKhhATCyY79GMk/ZUdhIcMgWBOHPlLusG2XJ0Kvytf jk9MzVtliEmNG6o6UYxVvvBjrNC8HWN2iiGo6zkpSo1NGzTEXboLTMbGI22/kbzmkCY4AU57NPrnX ANdhiTH8pUq/KSr8zNLQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4gS2-0000000FRYR-2TF4; Wed, 08 May 2024 12:31:14 +0000 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4gRu-0000000FRU3-40du for linux-arm-kernel@lists.infradead.org; Wed, 08 May 2024 12:31:12 +0000 Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-a59a387fbc9so1090210666b.1 for ; Wed, 08 May 2024 05:31:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715171465; x=1715776265; darn=lists.infradead.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=PvskylCoCM4TGyFAD0Ni5/k+Obqef8+RlkP1gi+7gz0=; b=COOLtD/2jv1+6RhQehBUALASyGrL5UFmTg0C/P4ULmbsx1urXziIEcaLVzygSt+Xaw bUBkRmvyOeRrKcxdq7Y1s7EsnfnrUU1uIM/c0WRpGi4+JDRB2UxNeewGO4ns/wivA+HK X93ddUDUKmpUzwd/EuzgBPfdXWS8HxsoQsDCSEnZxpD913ujjQlQc0LklhJYHzxNbxOP 5O2grmdx98hnrmsrrcMwAFCdlCQ1k4K4f2CYm3+95ORjVa+qzC7h7mCZ4nHrRWIs8E2j iL20ODbwpCfhhKelB09GnlhCTpmPytL01G6I4dXo7hn3KJ5O54HrlNs818J403qO0aQU blCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715171465; x=1715776265; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=PvskylCoCM4TGyFAD0Ni5/k+Obqef8+RlkP1gi+7gz0=; b=edRN8q3BMv21J/UisNUcBObnzZrv/88sSs0/uqZVKyLfvIQRNpBy7zKOQvgqL0w/2E Ith2bo/5C6FpQvt9xin+QBFpqyDmDl5fI3TEyN6ncyRer1ocx5m3odMMR9frMzMiDNRo lLWgke09S3Yy0kofqDunFCotZtHtbJPEIe0bYP//s6q3o15/0m3C1EtHJAEGUxyDDuhN GMo6hsHBN3b/EOTkUMKpbvpLCPdBn+WUwRWRT9ugP8UBxesfCv66HNHZIz7bVsP3EPCn CEvtbUvR/4w5FGpM/8E9WDGn140BaLokZSoE22SsWMu0F/dhL4u+lm3zqLjvfpxj0HAp ITdA== X-Forwarded-Encrypted: i=1; AJvYcCUXzfMoh73Lm93y3s2384z5AAPSvwPXvKRkLCfwacl07nQ4Exkf1p1iSAZQ1MrzSMEqEBsKABiKRrCZVcuBuv5FhvHktmhGdkXeJ3YfgCYgLFRlO9U= X-Gm-Message-State: AOJu0Yyt5ROnhyl/JoJpkHfhUk2Au8YkV91twNh/qQCJ4pi2QZNG8W4+ jPW5nyiyW/u7fKcLx6MBvseK3CIVP9alUjF1TzUjLpkus1F7hsbjw9yHm0GiFsc= X-Google-Smtp-Source: AGHT+IHfBM6/97ZL/jz+mDbZXN+ZoyZROPPx8q1R59a4i7BYeDoYLd2VcD04ZDBe3HyHqZcPnwxIkQ== X-Received: by 2002:a17:906:aec7:b0:a59:affe:b9f with SMTP id a640c23a62f3a-a59fb923376mr157625866b.6.1715171464771; Wed, 08 May 2024 05:31:04 -0700 (PDT) Received: from localhost ([102.222.70.76]) by smtp.gmail.com with ESMTPSA id gz20-20020a170906f2d400b00a5a0c9e16f1sm160306ejb.51.2024.05.08.05.31.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 05:31:04 -0700 (PDT) Date: Wed, 8 May 2024 15:31:00 +0300 From: Dan Carpenter To: Dave Stevenson Cc: Mauro Carvalho Chehab , Florian Fainelli , Broadcom internal kernel review list , Ray Jui , Scott Branden , Sakari Ailus , Ricardo Ribalda , Laurent Pinchart , Hans Verkuil , Jean-Michel Hautbois , linux-media@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] media: bcm2835-unicam: Fix a NULL vs IS_ERR() check Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240508_053107_027898_2E9661A3 X-CRM114-Status: GOOD ( 14.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The media_pad_remote_pad_unique() function returns error pointers, not NULL. Update the check accordingly. Fixes: 392cd78d495f ("media: bcm2835-unicam: Add support for CCP2/CSI2 camera interface") Signed-off-by: Dan Carpenter Reviewed-by: Laurent Pinchart --- drivers/media/platform/broadcom/bcm2835-unicam.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/broadcom/bcm2835-unicam.c b/drivers/media/platform/broadcom/bcm2835-unicam.c index 3c7878d8d79b..ad55fc930e5b 100644 --- a/drivers/media/platform/broadcom/bcm2835-unicam.c +++ b/drivers/media/platform/broadcom/bcm2835-unicam.c @@ -2433,9 +2433,9 @@ static int unicam_async_bound(struct v4l2_async_notifier *notifier, return ret; source = media_pad_remote_pad_unique(sink); - if (!source) { + if (IS_ERR(source)) { dev_err(unicam->dev, "No connected sensor pad\n"); - return -ENOTCONN; + return PTR_ERR(source); } unicam->sensor.subdev = subdev;