Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp856967imu; Fri, 7 Dec 2018 09:58:29 -0800 (PST) X-Google-Smtp-Source: AFSGD/WlyddGnhRfQN1+evlwuswucLQ6so8Ao5evnGEMP644t6BjgFGWs95YFSHBJLldDgaVdxq/ X-Received: by 2002:a63:5d55:: with SMTP id o21mr2767552pgm.92.1544205509547; Fri, 07 Dec 2018 09:58:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544205509; cv=none; d=google.com; s=arc-20160816; b=bTSlG2L3IQ0SAHeYE60Hv+ztOpT06vvzQnM3pjZrV9Zx4FRFZUlprkqA3UwTM/WV2e Bp2JrUZdQKk9ds/RC9Q/KLwBukD/9wT2YOE5aPtEB4E8uMmJ2QdSaWQrL461I1ValzM7 /TKxv1lXk6I/N5nCeG6UTyRmu7Ngpvgq3XtkH/X26FtF5KSHBydhO/lgUKFfC4kY40H4 ChpEtY80/TuFl2CZfoWQhZkWpimMujTFiwAfz/qdE1oIgPXvkTtHVk8Y73dXYbKuy4Wt C4dop9WT+wgGGb4rSsiYhCeN7drqCEtzX4H+NZ+2xegSw6skRYzCR8VkC4M+Lx+WOGB0 62DA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=zK8Edooo7T1geX9HqFF/IWyNGSTpAaS2TPlvuXKaMy4=; b=N+Y6ZszoDxuus9UYvpHbx9Epo3HAnPOS6f0P1ZsCHca/Vquhch/2fNROrjDfyV6N5I n6xltTvBt/unmX3a9R0r5LCTNC4SS5YTb2P0okbuV2T9q47NDK2nIjDKorQwwCGDMXLJ dvRYNSnk2wL07GXtbo/DJ6Rbu7TpVwNLn5hHRBm5/Cx+alf8fAHskEctI4YMU4QrT/G/ B07CCLin6oj2phNPY36MnmE31Vr/hXclVGwU6eyS6W9FUjPIE9b6o+KVaFgqmoJ6ydRv tH0pT58M/ckKOr6AI5FmXOIA7uyd4FSE9LSAUQAcDdHXRmE+5Ls4uReqNtqGKp8QFPZE Xrfg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i198si3723920pfe.289.2018.12.07.09.58.14; Fri, 07 Dec 2018 09:58:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726206AbeLGR5V (ORCPT + 99 others); Fri, 7 Dec 2018 12:57:21 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:59522 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726083AbeLGR5T (ORCPT ); Fri, 7 Dec 2018 12:57:19 -0500 Received: from localhost.localdomain (unknown [IPv6:2804:431:9719:1d1c:60c2:167c:a334:f7b3]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: koike) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 864AA26042B; Fri, 7 Dec 2018 17:57:04 +0000 (GMT) From: Helen Koike To: linux-media@vger.kernel.org Cc: hverkuil@xs4all.nl, mchehab@kernel.org, lkcamp@lists.libreplanetbr.org, kernel@collabora.com, linux-kernel@vger.kernel.org Subject: [PATCH] media: vimc: fix start stream when link is disabled Date: Fri, 7 Dec 2018 15:56:41 -0200 Message-Id: <20181207175641.1982-1-helen.koike@collabora.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If link is disabled, media_entity_remote_pad returns NULL, causing a NULL pointer deference. Ignore links that are not enabled instead. Signed-off-by: Helen Koike --- drivers/media/platform/vimc/vimc-common.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/platform/vimc/vimc-common.c b/drivers/media/platform/vimc/vimc-common.c index dee1b9dfc4f6..867e24dbd6b5 100644 --- a/drivers/media/platform/vimc/vimc-common.c +++ b/drivers/media/platform/vimc/vimc-common.c @@ -276,6 +276,8 @@ int vimc_pipeline_s_stream(struct media_entity *ent, int enable) /* Start the stream in the subdevice direct connected */ pad = media_entity_remote_pad(&ent->pads[i]); + if (!pad) + continue; if (!is_media_entity_v4l2_subdev(pad->entity)) return -EINVAL; -- 2.19.1