Received: by 10.223.185.116 with SMTP id b49csp336008wrg; Thu, 15 Feb 2018 23:06:42 -0800 (PST) X-Google-Smtp-Source: AH8x224yQ1NAEoyHyAktbTsKQHv9+QEmH2JEL+Gp/InSqWYFE8/tKvTKTzgvmXkAEogIQ+rXOciT X-Received: by 10.101.97.175 with SMTP id i15mr4290548pgv.55.1518764802433; Thu, 15 Feb 2018 23:06:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518764802; cv=none; d=google.com; s=arc-20160816; b=TbhMEE/V+gKDY8IpRjqNPuG6XYUFhbHwR38Rt5VbCRtiznrCMaomhvv7n8GYVqdLu3 eTx/wdW5AbeGE2oxb2ZefQ1CPq1m3GbajXCnxKp8kI2RybXb88QjfOXBlGAF1YWfQv4s 9vh8myo1+7Eue3qDtZNNkxdJgf0uMiIKGmAsXzR++mOMinTyu6Y5eKA/uduZ3goenFm6 yDz51JgHuEkr0dHTfYDLvFjLBHeJXCEAuwVXAI3bUh77A4n1vPghsYeem0Zn9O0ihgNy i7gnnXYOupwYSXN7P/dBi16aTm3FcQXKugc6HyMfwqcR7rkitPyYWzXHAMdOq3u82pUC q4+A== 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=iT5wO5iPnALTCuTpQyIjB8BCH1RoVCtEoUjbUBBY5J4=; b=CEkTIK13ta4XZX7sAefCsxWO0adPjWGzQbaXBOuyhnm6PWCRZ2HcXkm73Ijpd4ggtn pehwIBZOKthznzRhX4d/mYQEVpNr4vpuHTnnFU1kM/T6SLDZRLDeYgbKfOkRcUziTU11 WQwLFB9kxRIawsICWNIYGBzq7Qw/RrurDcKtHFPV5/QtU+/AEXVl6LnvJMCbwX7jWo+e hVqOs0nIREgWu905HjLc2eXv61nRMVr41zRLNXAynz9AywNU6CYFTo6RWugxgL3VRGSk EDvLq5lfGNp66XRDvI8RT5l9OzECnIaTjWv10RUm9oDCN2UZ7lguvMaV06jYAkE6/5yT VLSg== 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 68si1075075pfx.60.2018.02.15.23.06.27; Thu, 15 Feb 2018 23:06:42 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1425500AbeBOQMa (ORCPT + 99 others); Thu, 15 Feb 2018 11:12:30 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:34838 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1424395AbeBOPpK (ORCPT ); Thu, 15 Feb 2018 10:45:10 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 7FFDE117F; Thu, 15 Feb 2018 15:45:09 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans Verkuil , Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab Subject: [PATCH 4.15 126/202] media: v4l2-compat-ioctl32.c: make ctrl_is_pointer work for subdevs Date: Thu, 15 Feb 2018 16:17:06 +0100 Message-Id: <20180215151719.815489578@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180215151712.768794354@linuxfoundation.org> References: <20180215151712.768794354@linuxfoundation.org> User-Agent: quilt/0.65 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.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Hans Verkuil commit 273caa260035c03d89ad63d72d8cd3d9e5c5e3f1 upstream. If the device is of type VFL_TYPE_SUBDEV then vdev->ioctl_ops is NULL so the 'if (!ops->vidioc_query_ext_ctrl)' check would crash. Add a test for !ops to the condition. All sub-devices that have controls will use the control framework, so they do not have an equivalent to ops->vidioc_query_ext_ctrl. Returning false if ops is NULL is the correct thing to do here. Fixes: b8c601e8af ("v4l2-compat-ioctl32.c: fix ctrl_is_pointer") Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus Reported-by: Laurent Pinchart Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c +++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c @@ -770,7 +770,7 @@ static inline bool ctrl_is_pointer(struc return ctrl && ctrl->is_ptr; } - if (!ops->vidioc_query_ext_ctrl) + if (!ops || !ops->vidioc_query_ext_ctrl) return false; return !ops->vidioc_query_ext_ctrl(file, fh, &qec) &&