From patchwork Wed Apr 4 08:17:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Katsuhiro Suzuki X-Patchwork-Id: 132799 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp4764791ljb; Wed, 4 Apr 2018 01:18:19 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/m9Vu1fpJl6N6cmwGZKbL48ADA4d6bYVwfzxcEK6iwJQv0nDZErkqcvXR8L0DLBPMaJzUr X-Received: by 2002:a17:902:525:: with SMTP id 34-v6mr17451274plf.267.1522829899653; Wed, 04 Apr 2018 01:18:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522829899; cv=none; d=google.com; s=arc-20160816; b=Q8zR/Yo0cOGY7m/DuACQ/0770ETtzQXgTmIKYFRPj0dQ78/jfRJFQO5ljB+Ax610Jx tV4fOKcBAHgtwcf4GjHolJ7PpD/3ITcwGY+AVivsMiQbOv2AcB/4qVSOBEbWsqNBRSBe QEzgtTi/q0r2bWIRpypIW8k2BF2N6jipMZoOlfHwR+trKtXu0Dvcuxt1Nzg2cFEo941v WLeyWT2gzUndNK0fuGrBFXlhX+bMRfLxdkKlK1VmHkqkkWq3bSpEaaLwdj6t2YXWRUFJ H6Ni7aD5EYwnKxLHcM7tKIgon0hagSFqbcyDlTEPBhM2iVEVEcMsfW5foNong6xIhMmz Zmgw== 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 :arc-authentication-results; bh=QulTSQ4SOMZulQrHZI3/aWd+NeHXaWzwgeG7BmCv2Yc=; b=yym5XZKhwMKXxwZzQYUUZENP1Q8xkYT4YR9coWtwFBgjZJdxRZ5mJNS4WUrkyhHyUf 6qNK2dP0wNH8FLxomVcMpqDvJH5Ge8honG8rxXhZOwllXxj7IaTTb/n9nWhhxf1mPAix mgmghhGBR/XEI2w8Fa3ZkvzfZdD16M7c51ngUoezvWi8izT7v57gOLh/0Qk6goftdpZR ctbht+PbOQ3hbU6J7suq8hV4hlXYw6iUcQKiHXRRzfFgjPeGPrAn72firVSMarpO/g6k PHvworAuJ5Z0stUEfQdHrwgXPtvAori6zN6W/i3MLwTjDVH1OrX6cdA+S3zDj/D/0WD1 p96Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-media-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 98-v6si5022500pld.142.2018.04.04.01.18.19; Wed, 04 Apr 2018 01:18:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-media-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-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751295AbeDDISR (ORCPT + 5 others); Wed, 4 Apr 2018 04:18:17 -0400 Received: from mx.socionext.com ([202.248.49.38]:57727 "EHLO mx.socionext.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751129AbeDDISQ (ORCPT ); Wed, 4 Apr 2018 04:18:16 -0400 Received: from unknown (HELO kinkan-ex.css.socionext.com) ([172.31.9.52]) by mx.socionext.com with ESMTP; 04 Apr 2018 17:18:14 +0900 Received: from mail.mfilter.local (m-filter-1 [10.213.24.61]) by kinkan-ex.css.socionext.com (Postfix) with ESMTP id E1A9C180D52; Wed, 4 Apr 2018 17:18:14 +0900 (JST) Received: from 172.31.9.51 (172.31.9.51) by m-FILTER with ESMTP; Wed, 4 Apr 2018 17:18:14 +0900 Received: from yuzu.css.socionext.com (yuzu [172.31.8.45]) by kinkan.css.socionext.com (Postfix) with ESMTP id BB74D1A159F; Wed, 4 Apr 2018 17:18:14 +0900 (JST) Received: from aegis.e01.socionext.com (unknown [10.213.134.210]) by yuzu.css.socionext.com (Postfix) with ESMTP id 948131207D1; Wed, 4 Apr 2018 17:18:14 +0900 (JST) From: Katsuhiro Suzuki To: Mauro Carvalho Chehab , linux-media@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Katsuhiro Suzuki Subject: [PATCH] media: dvb_frontend: fix wrong cast in compat_ioctl Date: Wed, 4 Apr 2018 17:17:56 +0900 Message-Id: <20180404081756.22962-1-suzuki.katsuhiro@socionext.com> X-Mailer: git-send-email 2.16.3 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org FE_GET_PROPERTY has always failed as following situations: - Use compatible ioctl - The array of 'struct dtv_property' has 2 or more items This patch fixes wrong cast to a pointer 'struct dtv_property' from a pointer of 2nd or after item of 'struct compat_dtv_property' array. Signed-off-by: Katsuhiro Suzuki --- drivers/media/dvb-core/dvb_frontend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.16.3 diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/dvb-core/dvb_frontend.c index 21a7d4b47e1a..e33414975065 100644 --- a/drivers/media/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb-core/dvb_frontend.c @@ -2089,7 +2089,7 @@ static int dvb_frontend_handle_compat_ioctl(struct file *file, unsigned int cmd, } for (i = 0; i < tvps->num; i++) { err = dtv_property_process_get( - fe, &getp, (struct dtv_property *)tvp + i, file); + fe, &getp, (struct dtv_property *)(tvp + i), file); if (err < 0) { kfree(tvp); return err;