From patchwork Fri Aug 8 07:47:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: matrandg@cisco.com X-Patchwork-Id: 4694621 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C2824C0338 for ; Fri, 8 Aug 2014 07:57:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 027A520173 for ; Fri, 8 Aug 2014 07:57:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 06DA420122 for ; Fri, 8 Aug 2014 07:57:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752939AbaHHH5b (ORCPT ); Fri, 8 Aug 2014 03:57:31 -0400 Received: from aer-iport-4.cisco.com ([173.38.203.54]:4380 "EHLO aer-iport-4.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751193AbaHHH5a (ORCPT ); Fri, 8 Aug 2014 03:57:30 -0400 X-Greylist: delayed 584 seconds by postgrey-1.27 at vger.kernel.org; Fri, 08 Aug 2014 03:57:30 EDT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1218; q=dns/txt; s=iport; t=1407484650; x=1408694250; h=from:to:cc:subject:date:message-id; bh=0YwSoXrz9re2/j70IjH8LlsEPNtvQtIK7LiefKeyXTY=; b=WGRFj5xqyLn2o4+ruV9d8Y5H8qXjPGY4kJLF5Bx7lggsE5MrKusLasRg KGBpE76s3WO/8Hm5zrJZ1zieYFWJBiINfgNLje+63KyTD8WhOZ1OtWGxw gabLXg1Q7WkvwBYxYlXkiaOmibwGlQbsOYUS3jvLfrBoXf4ng+5p97G2L 8=; X-IronPort-AV: E=Sophos;i="5.01,823,1400025600"; d="scan'208";a="132074446" Received: from aer-iport-nat.cisco.com (HELO aer-core-3.cisco.com) ([173.38.203.22]) by aer-iport-4.cisco.com with ESMTP; 08 Aug 2014 07:47:44 +0000 Received: from mra-pc.rd.tandberg.com ([10.47.19.120]) by aer-core-3.cisco.com (8.14.5/8.14.5) with ESMTP id s787ligL004333; Fri, 8 Aug 2014 07:47:44 GMT From: matrandg@cisco.com To: linux-media@vger.kernel.org Cc: matrandg@cisco.com Subject: [PATCH] v4l2-ioctl: The result of VIDIOC_S_EDID should always be returned Date: Fri, 8 Aug 2014 09:47:41 +0200 Message-Id: <1407484061-26651-1-git-send-email-matrandg@cisco.com> X-Mailer: git-send-email 1.8.4.5 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-15.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY, USER_IN_DEF_DKIM_WL autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Mats Randgaard VIDIOC_S_EDID can return error and valid result Documentation/DocBook/media/v4l/vidioc-g-edid.xml: "If there are more EDID blocks than the hardware can handle then the EDID is not written, but instead the error code E2BIG is set and blocks is set to the maximum that the hardware supports." --- drivers/media/v4l2-core/v4l2-ioctl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index d15e167..f36c018 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -2554,9 +2554,9 @@ video_usercopy(struct file *file, unsigned int cmd, unsigned long arg, err = -EFAULT; goto out_array_args; } - /* VIDIOC_QUERY_DV_TIMINGS can return an error, but still have valid - results that must be returned. */ - if (err < 0 && cmd != VIDIOC_QUERY_DV_TIMINGS) + /* VIDIOC_QUERY_DV_TIMINGS and VIDIOC_S_EDID can return an error, but + still have valid results that must be returned. */ + if (err < 0 && cmd != VIDIOC_QUERY_DV_TIMINGS && cmd != VIDIOC_S_EDID) goto out; out_array_args: