From patchwork Tue Aug 10 10:33:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Foss X-Patchwork-Id: 494338 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:396:0:0:0:0 with SMTP id y22csp3811205jap; Tue, 10 Aug 2021 03:33:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5QKk5A0hgkJyTrL74JaKHuyX2a0eT5TidB2u9xYTt2c4BOc2khG9B9rzd9fMDM+ByZq32 X-Received: by 2002:a05:6e02:1b88:: with SMTP id h8mr255368ili.48.1628591630791; Tue, 10 Aug 2021 03:33:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628591630; cv=none; d=google.com; s=arc-20160816; b=p6kANyXssBaFXim/eZlCGcojog4bCgkpAZ+SOuqH4fxknAAAanV+cEPib+qiBKhB4Q 1DMSUgh3hV2r0+AFeOkoPZ38rb9MDGPvUYyINvtV0pNtJKKMfUMk77ArvNfrnynEA4Fq GRGngDkHy/o6bDId59Lt5zDVxuwViQT4RXd2sYAcjppfyzY1nCfYp3VV0DKdeQrZWmP+ OuZHxxT//gC8adUsSRsrC4Ajc3ubnvuudhZtfP40TBCDmi+Fj7kEDsepSSG7ranqsEox yf6ENke/VQ/lJu4A4G2H4v4lmASmR8cmxJrRdo8hcBoOeWmr6ZIkP+FS+QP8HkvLO6bS n7fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=2bWdJTFdBT7N/3z85xLhwFZMuV51xWxicxyG3tsUzjw=; b=RuuUlcC+EGlz6/HM21z3jF31+JWUYKUyDCymtNwDXunnsLHpWC7K4jLNLn5XIliYBI TGt6c0nCE3W7hOpguMwBGv6yOOGG2tAXJD0tsezd17E0F/TYLYaFgpNRelJurGVCFRYm JQu780MAAWMkthOmDpxFXMLPnqaIW2kAprTp0vQUAN4/ApvhqfSc/Ng2EVTlG7LseBcd cIWbU4vKE7h2vwkAvoeMuay75Augmihu9bSmm/PJ4jYz4Lb0J7JIZwZRb+zRw+9PbeU1 rB29Kq8+4RFELRSBljBo9wWj+NzhCgPb0OGWgoARM0ZAMpb4ByvxzSsmOrnj7CoZ8v5K vCew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mvRdNz7V; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k12si20311704ilu.161.2021.08.10.03.33.50; Tue, 10 Aug 2021 03:33:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mvRdNz7V; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239840AbhHJKeL (ORCPT + 16 others); Tue, 10 Aug 2021 06:34:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239837AbhHJKeL (ORCPT ); Tue, 10 Aug 2021 06:34:11 -0400 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 494D6C061799 for ; Tue, 10 Aug 2021 03:33:49 -0700 (PDT) Received: by mail-ed1-x529.google.com with SMTP id n12so5628365edx.8 for ; Tue, 10 Aug 2021 03:33:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=2bWdJTFdBT7N/3z85xLhwFZMuV51xWxicxyG3tsUzjw=; b=mvRdNz7Vkqu05ilLJvoACACdnCvcJVMLUYbUPaNL+3cTjW8wY+HilTjVlloB12hcjI yNPsqL0wpi/DPfdBJaTRQSA/Z/OXF/3HRwgz8r2m8Bk2Az9xwlkYHEDEOww+autydtzl LaQpPjigXb1VmNTxp/aX1ZfywweB05/o0TdJVH4lo2KYT8V5avgSKQ+/cGixrLNxrokA pUyfrpxCKKQ/mY/grrCBvthFm7dIvkX6y4Zo0LezTqRRJxucIQTMIVB9UffGbkvKN36F S6myo1MSwbFKIbsjwYFH8e80i98Fnjs1LgefWogL3H735N+hAHCE0dcYyVyeUB7CN5eI 5KZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=2bWdJTFdBT7N/3z85xLhwFZMuV51xWxicxyG3tsUzjw=; b=iSMfeQLiT/OMd1oukrOdDjqjyzpbo36gDfBDKbsuW2Fp4WP58ESwoSH6Tm7dcHUQlZ 9wr6qWJjcAdsGVf+67S/J4C1iqSjWls29SsZShpn5WgM7kznQP/+Jwjm3gAr1dAoLlcx 9PYXdjLQSUe/127COrteruyC4aHqLw+2SomuKDIgJWo93VYIaZdx5hMMYGyRc/lelk5T JNqENSHAjK4a4cZJ1eVhqQo/ujNpLYcQgdW3xb5JeUfrpYmVCKFdQ1JxVtCvSH/0nYaQ vhuFGzjy+CBYPIpYIuR+RVwVCRvLxP1vkFxfLlJ2/2dN5WzHNeSCK9ZY/MZF7FpTL0fS cSWA== X-Gm-Message-State: AOAM530sbwM3zLG0atYokoV3ySAOMpwGCOWYth0qr1MPfPbwN2jSoLSR 6n2J/kkB4Zra+MxdZvNB+YbOWA== X-Received: by 2002:a05:6402:4387:: with SMTP id o7mr4085082edc.204.1628591627769; Tue, 10 Aug 2021 03:33:47 -0700 (PDT) Received: from xps7590.fritz.box ([2a02:2454:3e5:b700:6e3b:3620:e85a:7152]) by smtp.gmail.com with ESMTPSA id e7sm9518357edk.3.2021.08.10.03.33.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Aug 2021 03:33:47 -0700 (PDT) From: Robert Foss To: robert.foss@linaro.org, todor.too@gmail.com, agross@kernel.org, bjorn.andersson@linaro.org, mchehab@kernel.org, hverkuil-cisco@xs4all.nl, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Naresh Kamboju , Hans Verkuil Cc: Linux Kernel Functional Testing Subject: [PATCH v1] media: camss: vfe: Don't use vfe->base before it's assigned Date: Tue, 10 Aug 2021 12:33:36 +0200 Message-Id: <20210810103336.114077-1-robert.foss@linaro.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org vfe->ops->hw_version(vfe) being called before vfe->base has been assigned is incorrect and causes crashes. Fixes: b10b5334528a9 ("media: camss: vfe: Don't read hardware version needlessly") Reported-by: Linux Kernel Functional Testing Signed-off-by: Robert Foss --- drivers/media/platform/qcom/camss/camss-vfe.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.30.2 diff --git a/drivers/media/platform/qcom/camss/camss-vfe.c b/drivers/media/platform/qcom/camss/camss-vfe.c index 6b2f33fc9be22..1c8d2f0f81207 100644 --- a/drivers/media/platform/qcom/camss/camss-vfe.c +++ b/drivers/media/platform/qcom/camss/camss-vfe.c @@ -1299,7 +1299,6 @@ int msm_vfe_subdev_init(struct camss *camss, struct vfe_device *vfe, return -EINVAL; } vfe->ops->subdev_init(dev, vfe); - vfe->ops->hw_version(vfe); /* Memory */ @@ -1309,6 +1308,8 @@ int msm_vfe_subdev_init(struct camss *camss, struct vfe_device *vfe, return PTR_ERR(vfe->base); } + vfe->ops->hw_version(vfe); + /* Interrupt */ r = platform_get_resource_byname(pdev, IORESOURCE_IRQ,