From patchwork Thu Sep 3 15:16:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 53029 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by patches.linaro.org (Postfix) with ESMTPS id F3BBF22E23 for ; Thu, 3 Sep 2015 15:17:32 +0000 (UTC) Received: by wicmn1 with SMTP id mn1sf19028874wic.1 for ; Thu, 03 Sep 2015 08:17:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:in-reply-to:references:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :mime-version:content-type:content-transfer-encoding:errors-to :sender:x-original-sender:x-original-authentication-results :mailing-list; bh=YoARQkxRd3Owydk2Gs4lQvrKD5ZGXe0CwbeiBcgRlU4=; b=A8uE16xftRTQC/fmrMQlqsF1wnYm1/ZsTpzI40zFHrwq0EBPITSPC7AW8t6lCA2+gB fslU5zqCogVSqXk4UYqwpX7wIFJLi08RGj2UpwJFF80RuPunx5GNRpw+sYrjUgRfaP4T S0AdFxZMtUUEODaeGT9yJkfa95QUnJT9uB1Nyq+unRB+1C0ja0ADf1mlcKkLZspR0mtg EQqWaUCALuhSh+JB8IM2wSCkwH/MdekTmZBe8KZCRPTLtRh+GPFO8p7TSYtmlsMZ9D4t JPoVjrvZdPKHJ9NtmSlVikA8voWfGTC1GOxRmRDkEdaWTqK4FPMnmsCIDeW74HI1YcIX X3rQ== X-Gm-Message-State: ALoCoQkuWKbrRoCmdXQCS41PHtghiNyrgI9A4V6ocr7s8gSfDmimzHv5YhtdhquUOX+cOmcY/YB+ X-Received: by 10.152.45.101 with SMTP id l5mr10847345lam.7.1441293452250; Thu, 03 Sep 2015 08:17:32 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.28.226 with SMTP id e2ls208761lah.14.gmail; Thu, 03 Sep 2015 08:17:32 -0700 (PDT) X-Received: by 10.112.234.165 with SMTP id uf5mr21664437lbc.91.1441293452030; Thu, 03 Sep 2015 08:17:32 -0700 (PDT) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com. [209.85.217.173]) by mx.google.com with ESMTPS id z12si23382370lby.131.2015.09.03.08.17.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Sep 2015 08:17:32 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by lbcao8 with SMTP id ao8so26289890lbc.3 for ; Thu, 03 Sep 2015 08:17:31 -0700 (PDT) X-Received: by 10.152.22.99 with SMTP id c3mr23057793laf.32.1441293451931; Thu, 03 Sep 2015 08:17:31 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.164.42 with SMTP id yn10csp1342368lbb; Thu, 3 Sep 2015 08:17:31 -0700 (PDT) X-Received: by 10.140.237.140 with SMTP id i134mr70293763qhc.81.1441293451040; Thu, 03 Sep 2015 08:17:31 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 35si30283840qgg.74.2015.09.03.08.17.30; Thu, 03 Sep 2015 08:17:31 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Received: by lists.linaro.org (Postfix, from userid 109) id 2D23E61A2C; Thu, 3 Sep 2015 15:17:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 2424361A2F; Thu, 3 Sep 2015 15:16:53 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id C489F61A0C; Thu, 3 Sep 2015 15:16:48 +0000 (UTC) Received: from mail-oi0-f54.google.com (mail-oi0-f54.google.com [209.85.218.54]) by lists.linaro.org (Postfix) with ESMTPS id C300E619F1 for ; Thu, 3 Sep 2015 15:16:47 +0000 (UTC) Received: by oixx17 with SMTP id x17so29499301oix.0 for ; Thu, 03 Sep 2015 08:16:47 -0700 (PDT) X-Received: by 10.202.226.73 with SMTP id z70mr25575998oig.64.1441293407201; Thu, 03 Sep 2015 08:16:47 -0700 (PDT) Received: from Ubuntu15.localdomain (cpe-24-28-70-239.austin.res.rr.com. [24.28.70.239]) by smtp.gmail.com with ESMTPSA id e73sm1525294oib.3.2015.09.03.08.16.46 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 03 Sep 2015 08:16:46 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org, maxim.uvarov@linaro.org Date: Thu, 3 Sep 2015 10:16:33 -0500 Message-Id: <1441293400-28777-2-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1441293400-28777-1-git-send-email-bill.fischofer@linaro.org> References: <1441293400-28777-1-git-send-email-bill.fischofer@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv2 1/8] linux-generic: schedule: correct schedule group handling X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: bill.fischofer@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Correct the range check on odp_schedule_group_destroy() and the associated handling of scheduler group names. Signed-off-by: Bill Fischofer --- platform/linux-generic/odp_schedule.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/linux-generic/odp_schedule.c b/platform/linux-generic/odp_schedule.c index dc2d75f..d2543ad 100644 --- a/platform/linux-generic/odp_schedule.c +++ b/platform/linux-generic/odp_schedule.c @@ -178,7 +178,7 @@ int odp_schedule_init_global(void) odp_spinlock_init(&sched->grp_lock); for (i = 0; i < ODP_CONFIG_SCHED_GRPS; i++) { - memset(&sched->sched_grp[i].name, 0, ODP_SCHED_GROUP_NAME_LEN); + memset(sched->sched_grp[i].name, 0, ODP_SCHED_GROUP_NAME_LEN); sched->sched_grp[i].mask = thread_sched_grp_mask(i); } @@ -685,10 +685,10 @@ int odp_schedule_group_destroy(odp_schedule_group_t group) odp_spinlock_lock(&sched->grp_lock); if (group < ODP_CONFIG_SCHED_GRPS && - group > _ODP_SCHED_GROUP_NAMED && + group >= _ODP_SCHED_GROUP_NAMED && sched->sched_grp[group].name[0] != 0) { odp_thrmask_zero(sched->sched_grp[group].mask); - memset(&sched->sched_grp[group].name, 0, + memset(sched->sched_grp[group].name, 0, ODP_SCHED_GROUP_NAME_LEN); ret = 0; } else {