Received: by 10.192.165.148 with SMTP id m20csp2544577imm; Sun, 22 Apr 2018 09:14:47 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/uqEWIORAQBihfz02yUupYqt78oQ0IB5XlgiXwwj6ZxIA+i7bHSjO9DbttT7+84i22mPe1 X-Received: by 10.101.68.129 with SMTP id l1mr14624517pgq.239.1524413687137; Sun, 22 Apr 2018 09:14:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524413687; cv=none; d=google.com; s=arc-20160816; b=Ck//9sphwpOW/KhpcKcCmlFmBV40cGIrioPsqBVjFMjVLqbiGO6A5ig8j54nXKXDa1 g6HJwIrhJ4FHVa3iUwSYOnUv9/OzjHibt/QRCkPA2ho5VG/3xeDqC2tNBPLofESD+YNZ MpIac0VGFZo68JkwJPfSnCdwZ0y9rDzJtNWkll3eXJld3El/6JQUwdc9VRW2EzRvIvPR lGmUl0B7J10dCTMpnW41thKNWCxOrvebFwn9kPBeN9Kfd4PtDPnzESs/6/QDCSMCuvia 1xv6tT7fJbOWoxFT9o2Yh4bQd+hVFWBKp12Ku0NJcrY2n/p0cOxKSM+MjuLXEefLLM7x nVaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=ud6eJlbW8WbpRsyP1vwPw34ggXACzQ0PDrAY5O6+YU4=; b=VT/O4WajERIpf/kRc4Kmw6esp8BcgA5UP4hEyllkns0FPdnBENCZuj+sC+bnRdnUt/ pWl7VdWnoMyAonLK+ZC0htKB1GX23Z+auH5jcrI3jZj7WZ19I73CSpvC6bQBbclhXBrx /hxy0Li0nb0jhWKj98dKBKiuWBT/QvXBgFSUDwf9b3aFBxEvmR8aeKc5T50Glbmz2MxH o1rYlKwKz8AvvqLoUM7IJB+kOMjjamnecgNzFqedbWSsOt5n/w2Fq/e1NnVKS0qTI3Rq msYz/n3QzDoD6SGqU5/Oqp+VYdh0VW/Angf9cCYMyXjmnj82GL3r9VA2/09y4eik0lrV dWmA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bc11-v6si9599815plb.43.2018.04.22.09.14.32; Sun, 22 Apr 2018 09:14:47 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753909AbeDVQMW (ORCPT + 99 others); Sun, 22 Apr 2018 12:12:22 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:44782 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751377AbeDVNzp (ORCPT ); Sun, 22 Apr 2018 09:55:45 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 0563D8FF; Sun, 22 Apr 2018 13:55:44 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans Verkuil , Mauro Carvalho Chehab Subject: [PATCH 4.16 032/196] media: vivid: check if the cec_adapter is valid Date: Sun, 22 Apr 2018 15:50:52 +0200 Message-Id: <20180422135105.760782426@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180422135104.278511750@linuxfoundation.org> References: <20180422135104.278511750@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Hans Verkuil 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: # for v4.12 and up Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- drivers/media/platform/vivid/vivid-vid-common.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/media/platform/vivid/vivid-vid-common.c +++ b/drivers/media/platform/vivid/vivid-vid-common.c @@ -874,7 +874,8 @@ int vidioc_g_edid(struct file *file, voi return -EINVAL; if (edid->start_block + edid->blocks > dev->edid_blocks) edid->blocks = dev->edid_blocks - edid->start_block; - cec_set_edid_phys_addr(dev->edid, dev->edid_blocks * 128, adap->phys_addr); + if (adap) + cec_set_edid_phys_addr(dev->edid, dev->edid_blocks * 128, adap->phys_addr); memcpy(edid->edid, dev->edid + edid->start_block * 128, edid->blocks * 128); return 0; }