From patchwork Mon Apr 13 21:01:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ola Liljedahl X-Patchwork-Id: 47134 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D4A7D20553 for ; Mon, 13 Apr 2015 21:02:00 +0000 (UTC) Received: by labgx2 with SMTP id gx2sf20858037lab.1 for ; Mon, 13 Apr 2015 14:01:59 -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: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=REABszsj7N27NkRF17TZ9M3TC+HuUflKmk4hU7zgGRM=; b=hpXQk+It7a5/UvdMlqWp7Q9RDLZL1BUQNKBEXiEkAdlxsbhA9fiJKv1XPQ0bFBz9xB ynhhoeri1v4AsFsEQxGf4u9Mi4aXmCsl45HFLXoLV5FLcLy7jEYo4mACJGyibdlc8Zmg Hc+rwi9oKn80QW65jTn/+rZ779gzAA3xscXpXEHfN9/lm7F5zfa9B8V5njYD8ELibNPC SXAL3tmn1U7svie0YDziCGjEN2/xSgFefuF45fcajAm9tRhCnn6/iCgfy1nWKgCEwBto bQeLuuak3u24PBN3iSXtCR88KjWjrTQZCAQw/znacct4FtL2uYRDO3pP+TLlabivSA32 380w== X-Gm-Message-State: ALoCoQn0bDF7VNrpAQbDod79+9eoQawPW9Z6kUrEQ6i1DJde/NLSbfWuecG74lCbDGAXChisUDI1 X-Received: by 10.152.37.101 with SMTP id x5mr2703535laj.5.1428958919792; Mon, 13 Apr 2015 14:01:59 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.21.199 with SMTP id x7ls783431lae.0.gmail; Mon, 13 Apr 2015 14:01:59 -0700 (PDT) X-Received: by 10.152.28.5 with SMTP id x5mr14786063lag.112.1428958919645; Mon, 13 Apr 2015 14:01:59 -0700 (PDT) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com. [209.85.217.171]) by mx.google.com with ESMTPS id j9si9321016lbc.32.2015.04.13.14.01.59 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Apr 2015 14:01:59 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by lbbuc2 with SMTP id uc2so69360681lbb.2 for ; Mon, 13 Apr 2015 14:01:59 -0700 (PDT) X-Received: by 10.112.199.133 with SMTP id jk5mr15462176lbc.32.1428958919518; Mon, 13 Apr 2015 14:01:59 -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.67.65 with SMTP id l1csp1445538lbt; Mon, 13 Apr 2015 14:01:58 -0700 (PDT) X-Received: by 10.140.44.69 with SMTP id f63mr19901551qga.88.1428958918221; Mon, 13 Apr 2015 14:01:58 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 16si12215463qkr.80.2015.04.13.14.01.57; Mon, 13 Apr 2015 14:01:58 -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 2F9D761D84; Mon, 13 Apr 2015 21:01:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 4BD9361D64; Mon, 13 Apr 2015 21:01:56 +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 2E92861D7E; Mon, 13 Apr 2015 21:01:54 +0000 (UTC) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com [209.85.217.169]) by lists.linaro.org (Postfix) with ESMTPS id 6FC3F61D64 for ; Mon, 13 Apr 2015 21:01:53 +0000 (UTC) Received: by lbbzk7 with SMTP id zk7so69457972lbb.0 for ; Mon, 13 Apr 2015 14:01:52 -0700 (PDT) X-Received: by 10.112.67.107 with SMTP id m11mr14940497lbt.43.1428958912443; Mon, 13 Apr 2015 14:01:52 -0700 (PDT) Received: from localhost.localdomain (78-82-118-95.tn.glocalnet.net. [78.82.118.95]) by mx.google.com with ESMTPSA id ml10sm656619lbc.29.2015.04.13.14.01.51 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 13 Apr 2015 14:01:51 -0700 (PDT) From: Ola Liljedahl To: lng-odp@lists.linaro.org Date: Mon, 13 Apr 2015 23:01:47 +0200 Message-Id: <1428958907-11382-1-git-send-email-ola.liljedahl@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: timers patch Subject: [lng-odp] [PATCH] linux-generic: timer: check for zero timer resolution 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: ola.liljedahl@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.171 as permitted sender) smtp.mail=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 Fail to create timer pool with zero timer resolution. https://bugs.linaro.org/show_bug.cgi?id=1451 Signed-off-by: Ola Liljedahl --- (This document/code contribution attached is provided under the terms of agreement LES-LTM-21309) platform/linux-generic/odp_timer.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/platform/linux-generic/odp_timer.c b/platform/linux-generic/odp_timer.c index 500f7f1..e5391dc 100644 --- a/platform/linux-generic/odp_timer.c +++ b/platform/linux-generic/odp_timer.c @@ -691,6 +691,11 @@ odp_timer_pool_create(const char *name, const odp_timer_pool_param_t *param) { /* Verify that buffer pool can be used for timeouts */ + /* Verify that we have a valid (non-zero) timer resolution */ + if (param->res_ns == 0) { + __odp_errno = EINVAL; + return NULL; + } odp_timer_pool_t tp = odp_timer_pool_new(name, param); return tp; }