From patchwork Thu May 2 05:15:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naresh Kamboju X-Patchwork-Id: 163237 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp5305999ill; Wed, 1 May 2019 22:15:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqxMrJDLtPtX2Q4W5osKmUx08BN3SXe9bqowv0soLZKtbnhd64/QzaMe+ZYMGTB+GDMzT06o X-Received: by 2002:a17:902:e402:: with SMTP id ci2mr1608237plb.154.1556774157988; Wed, 01 May 2019 22:15:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556774157; cv=none; d=google.com; s=arc-20160816; b=zZJM6iGELIc4OzQqnmWuB76bUi+BwAL/vYOUpr1/DMgoGeSKlatrKnw+FScqbBRChf z1szwF4GEcAs6zG1mr6/puPVqvLungC8LQBH7DEvEnk8rGRbuv257ulBfACCBDW4R/I8 hOxGK7dHlDtmoyAmg63TGNiSE/eaww8tex0Xzx4PnEoQi/K1V+fFM0UYk/UHHCH3nDcS 6H9lu93HWkLEJzwrHqFyWvo82IiUztnujOKENdPa3Q2m9CqAJy72rM1I2OQHLw82Kjee 0Dd6KnIstiD7Ryh5Q+x3Ac6vtmJefK8I02gyp3OM1NpOd45+6l08NKhxsNaeydhT9Avb 38+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=AfysjtlVKQZM/hiHS9iA8C8ubLk6xPLMqs6dI0UAgSs=; b=mRN/XF3qmiTQgbEdZwvTBDTI3UFXBAj2q6e3DbCXF2qdTjxuujtvxGEVpUXaSDRjE8 B1P7u9BxRubksQAqSjwkWV+I6reW0OpJZAjX/QY33XC6mqn0Unm9Vsh29OQCZ1EnaIYR wl+5louv62Z3OwM+bEJ5Vlc4Mun0R65UTQiKh3vETVxNjyaqtvQ4cA4+b7NPJNKsARrs r3OC8KpLDEYuVW04sUnz8vmSHQU0TRkepVd8g9Ay7ney9aASeqtfwhUTlSXLdsH7U5hC O5oqNqdmVM+hK5sBlBViDylbEwqQ6LD4JA6Fkm8x66Qtdeo4gZrn05cP1eEaAWxjJz8c q9FQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GFxR1W3j; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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. [209.132.180.67]) by mx.google.com with ESMTP id d40si1918576pla.87.2019.05.01.22.15.57; Wed, 01 May 2019 22:15:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GFxR1W3j; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 S1725763AbfEBFP4 (ORCPT + 14 others); Thu, 2 May 2019 01:15:56 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:35325 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725681AbfEBFP4 (ORCPT ); Thu, 2 May 2019 01:15:56 -0400 Received: by mail-wr1-f67.google.com with SMTP id f7so1410880wrs.2 for ; Wed, 01 May 2019 22:15:55 -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; bh=AfysjtlVKQZM/hiHS9iA8C8ubLk6xPLMqs6dI0UAgSs=; b=GFxR1W3jnTujBgrBVT/wt89CroTvmca3XzDeNVPU5WyU+DxZvssSuuxFprCmLczkS+ yNXzw9aTeLp+RuQN1Bnkg99hYK8uISPWAxRYpMucpsaeor9vt5/yugx9boid4CemHj0/ kIlY1lSnuVxh02NXclgIQa3RFvTQvFjX2/TNGAOBU8G+WHQwzjw22SqyCZ9yl9ODJj5O uxQKCYDOHXbaDa7+yWcWskfDXXeW5og9ZbkdZQ1Sk2Gaqnpwghb9nkR5pD0M8p3NNEeF mKnLgGF35//GVlndbC474cC9AjT7q9nIAsqUPyrEZpH9/PwL80gQEplRi9Hx4z6OLUx0 ituQ== 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; bh=AfysjtlVKQZM/hiHS9iA8C8ubLk6xPLMqs6dI0UAgSs=; b=rm9M/VyoKeDg1feqGk6eapa1CRWzUKgwdYZLSFS3YNguTzXKJ7r+DbQPTwkDvX8gXk 2iC4upxK554D5gKm0rCmgWuMh2dqetnpX1iwSW0ETdc91vU68b1EbBVL+GBaxlZaIT9E oELF1YUZGIcml9/qwZJUe1FomcXlRmNxNkQ4J6Qj9ksd7XD4ArvwMLVIhyQF9Qj6cQAv 15lYBpAiPMgRiK5JRjzHWYW9LsfS9KHFAPl7hqvyBAxjN3vrzdhO0xCBIZz2DZFt7I/s IODCq7/Nq0kRCdPNRgaw0XwjRLeOZhEAarfbJx/pwpm8B3fkppD7P/ooF4olrc3q0TUn eCNw== X-Gm-Message-State: APjAAAVbWkC91Mpuguem2TYUrYkZ4IUymJk1oP//5HVZ0W2YXS9WcY2+ f+W5ibN7Inhitly1xeEUTdmDXpwfVGb5rQ== X-Received: by 2002:adf:dd12:: with SMTP id a18mr1197444wrm.188.1556774154467; Wed, 01 May 2019 22:15:54 -0700 (PDT) Received: from hackbox2.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id z6sm21726719wrw.87.2019.05.01.22.15.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 May 2019 22:15:53 -0700 (PDT) From: Naresh Kamboju To: stable@vger.kernel.org Cc: Naresh Kamboju , Hans Verkuil , Mauro Carvalho Chehab Subject: [PATCH 4.9] media: vivid: check if the cec_adapter is valid Date: Thu, 2 May 2019 06:15:46 +0100 Message-Id: <20190502051546.12515-1-naresh.kamboju@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org commit ed356f110403f6acc64dcbbbfdc38662ab9b06c2 upstream. If CEC is not enabled for the vivid driver, then the adap pointer is NULL and 'adap->phys_addr' will fail. Cc: # v4.9 Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab [ Naresh: Fixed rebase conflict ] Signed-off-by: Naresh Kamboju --- drivers/media/platform/vivid/vivid-vid-common.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/media/platform/vivid/vivid-vid-common.c b/drivers/media/platform/vivid/vivid-vid-common.c index f9a810e3f521..d380c2da1926 100644 --- a/drivers/media/platform/vivid/vivid-vid-common.c +++ b/drivers/media/platform/vivid/vivid-vid-common.c @@ -841,6 +841,7 @@ int vidioc_g_edid(struct file *file, void *_fh, if (edid->start_block + edid->blocks > dev->edid_blocks) edid->blocks = dev->edid_blocks - edid->start_block; memcpy(edid->edid, dev->edid, edid->blocks * 128); - cec_set_edid_phys_addr(edid->edid, edid->blocks * 128, adap->phys_addr); + if (adap) + cec_set_edid_phys_addr(edid->edid, edid->blocks * 128, adap->phys_addr); return 0; }