Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935765AbdCJJbK (ORCPT ); Fri, 10 Mar 2017 04:31:10 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:41312 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935683AbdCJJav (ORCPT ); Fri, 10 Mar 2017 04:30:51 -0500 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab Subject: [PATCH 4.10 019/167] [media] media: Properly pass through media entity types in entity enumeration Date: Fri, 10 Mar 2017 10:07:42 +0100 Message-Id: <20170310083958.207308507@linuxfoundation.org> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170310083956.767605269@linuxfoundation.org> References: <20170310083956.767605269@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 List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1396 Lines: 37 4.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sakari Ailus commit 98d85f3cb912fde14593ead54dea4c1a00b3966f upstream. When the functions replaced media entity types, the range which was allowed for the types was incorrect. This meant that media entity types for specific devices were not passed correctly to the userspace through MEDIA_IOC_ENUM_ENTITIES. Fix it. Fixes: commit b2cd27448b33 ("[media] media-device: map new functions into old types for legacy API") Reported-and-tested-by: Antti Laakso Signed-off-by: Sakari Ailus Acked-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- drivers/media/media-device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/media/media-device.c +++ b/drivers/media/media-device.c @@ -130,7 +130,7 @@ static long media_device_enum_entities(s * old range. */ if (ent->function < MEDIA_ENT_F_OLD_BASE || - ent->function > MEDIA_ENT_T_DEVNODE_UNKNOWN) { + ent->function > MEDIA_ENT_F_TUNER) { if (is_media_entity_v4l2_subdev(ent)) entd->type = MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN; else if (ent->function != MEDIA_ENT_F_IO_V4L)