From patchwork Wed Sep 21 00:30:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 9342635 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 633A7607D0 for ; Wed, 21 Sep 2016 00:31:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4E49729227 for ; Wed, 21 Sep 2016 00:31:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 42B4829274; Wed, 21 Sep 2016 00:31:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D0CA292A8 for ; Wed, 21 Sep 2016 00:31:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754744AbcIUAbC (ORCPT ); Tue, 20 Sep 2016 20:31:02 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:36729 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754596AbcIUAbB (ORCPT ); Tue, 20 Sep 2016 20:31:01 -0400 Received: by mail-pf0-f193.google.com with SMTP id n24so1577628pfb.3 for ; Tue, 20 Sep 2016 17:31:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ingics-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=2yWapqkzAGlJco3AK5hCJ9fJ3K4n7XrPhmvnX18q/F0=; b=d8ESZKF1BYchZnwc1IzyR12dljouEdmipo2fet4hL6tz2x8qQw9/ehIcUKPGqw1KDH DaGk2ymkvQ0vwVsQs5GFGWSysSKj+8XdkPoOOeU5Cs2Bz+VW06mkYfTtrZrSG5UB+J1d 1gRz9SQqIEearuOC8Uf9v8sVey2udVU8gxZxwksxrjflMIsUX3HF2MvQeR01uy+A4bcE 70i13jh1NCiJw0WJwU/7G73rFUX1Mb1M810KnfKG/QhbtfufjbYWErMnLEW1BmbRONWM P4rqg2WCdb7f0KoU8xQD7fFVAYHaxS4jicNgTTHbOVHy4MxV5w+4YuZPtv+RPQcPhfvf 1o9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=2yWapqkzAGlJco3AK5hCJ9fJ3K4n7XrPhmvnX18q/F0=; b=SZ281caU0KpWbgfWWvkSjyKetbp5i8XpenT4MVeAQCsazM/NJAJqgbDpzIE09MmdLX RI6PyCQFxEsycROCxgIbv8ZrW8qw9g26UVPRN+Oo+xj8ZHC7mSSWavGe7qqqPNWlheN1 d6Jad9gGUwg2n4gaDPbTs0ju7LdZyuAOQdfSqSSuBaDp1VMskH/ULD6JhHmIuwHfsKRP j3wLik0Z21t2XHVyXtIfZW5extyTifRlNokMcnGYNZxC1WDuhBhi84eN+B5yHqOGmnyz /YiNfqU/p2Sks9eW6+pxGYk1SnMJBtgADo9kX4uAEbuIXB//1lrjwsNx4c0B3p1lrqEM ohRw== X-Gm-Message-State: AE9vXwO8V37hQZ37VVf4fKdH6TnH+tbpM/X/Kyo16sq10/GMJeCkYLgsADNSe/sNBYY25w== X-Received: by 10.98.82.200 with SMTP id g191mr46993460pfb.84.1474417860479; Tue, 20 Sep 2016 17:31:00 -0700 (PDT) Received: from localhost.localdomain (59-115-243-103.dynamic.hinet.net. [59.115.243.103]) by smtp.gmail.com with ESMTPSA id wr8sm41724070pab.44.2016.09.20.17.30.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Sep 2016 17:30:59 -0700 (PDT) From: Axel Lin To: "Rafael J . Wysocki" Cc: Chanwoo Choi , MyungJoo Ham , Kyungmin Park , linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, Axel Lin Subject: [PATCH] PM / devfreq: exynos-ppmu: ppmu_events array should not be NULL terminated Date: Wed, 21 Sep 2016 08:30:40 +0800 Message-Id: <1474417840-7999-1-git-send-email-axel.lin@ingics.com> X-Mailer: git-send-email 2.7.4 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The rest of the code uses ARRAY_SIZE to count the number of entries in ppmu_events array. The NULL terminated entry makes ARRAY_SIZE return off-by-one value. Signed-off-by: Axel Lin Acked-by: Chanwoo Choi --- drivers/devfreq/event/exynos-ppmu.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/devfreq/event/exynos-ppmu.c b/drivers/devfreq/event/exynos-ppmu.c index f55cf0e..c9ffaf0 100644 --- a/drivers/devfreq/event/exynos-ppmu.c +++ b/drivers/devfreq/event/exynos-ppmu.c @@ -90,8 +90,6 @@ struct __exynos_ppmu_events { PPMU_EVENT(d1-cpu), PPMU_EVENT(d1-general), PPMU_EVENT(d1-rt), - - { /* sentinel */ }, }; static int exynos_ppmu_find_ppmu_id(struct devfreq_event_dev *edev)