From patchwork Mon Apr 13 20:58:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ola Liljedahl X-Patchwork-Id: 47133 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B38C620553 for ; Mon, 13 Apr 2015 20:58:45 +0000 (UTC) Received: by widjs5 with SMTP id js5sf15423487wid.3 for ; Mon, 13 Apr 2015 13:58:45 -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=ewgCXg2ybFjNZ1l50ZqMMvxM6MTkvZ0Hy6PshGGpxkh+IkKnAqteeyGPVam+ioE465 JjWUf5FG1sKdTOPGXs9UP6ibtMNHfItuKPK1FmkGOfsA/GdYNOeaEBx+8QdHcfwgb4cs eaS+DKKQAO0TLPanVJ+7UDk+Ynkiz/WxJu9ChsHO7wNj0e8jwj1cDfi3FFyIE4RQu7j0 1rcJp48FwDthS23YYa8eVGsboiTr84X5XXOgB0k/jMKm9/AAKQ3fgfWmyPpE6Qs+LQ/v qbiHPXZnAEqeJJSlBm+pYHe4/5zEoEEVOL6uXaE5kRtgUt46RM0pM8YDJjxJrQwzrRoI v/Jg== X-Gm-Message-State: ALoCoQkz+4tDdKSqiqeqcZJSTdeWg0RveToAnYNO9Xu5TiFlZWVHPrhW5WI5hQfrMXzpCTNiJVR0 X-Received: by 10.112.151.146 with SMTP id uq18mr2945159lbb.20.1428958724975; Mon, 13 Apr 2015 13:58:44 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.205.37 with SMTP id ld5ls166068lac.52.gmail; Mon, 13 Apr 2015 13:58:44 -0700 (PDT) X-Received: by 10.112.54.165 with SMTP id k5mr15142290lbp.57.1428958724831; Mon, 13 Apr 2015 13:58:44 -0700 (PDT) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com. [209.85.217.180]) by mx.google.com with ESMTPS id df12si9304823lac.57.2015.04.13.13.58.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Apr 2015 13:58:44 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) client-ip=209.85.217.180; Received: by lbbqq2 with SMTP id qq2so69275438lbb.3 for ; Mon, 13 Apr 2015 13:58:44 -0700 (PDT) X-Received: by 10.152.36.2 with SMTP id m2mr14818527laj.72.1428958724741; Mon, 13 Apr 2015 13:58:44 -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 l1csp1443869lbt; Mon, 13 Apr 2015 13:58:44 -0700 (PDT) X-Received: by 10.140.148.20 with SMTP id 20mr20827341qhu.67.1428958723565; Mon, 13 Apr 2015 13:58:43 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 132si12204718qhx.34.2015.04.13.13.58.42; Mon, 13 Apr 2015 13:58:43 -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 8B43A61D83; Mon, 13 Apr 2015 20:58:42 +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=unavailable 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 BA1C861D2F; Mon, 13 Apr 2015 20:58:40 +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 AD0ED61D65; Mon, 13 Apr 2015 20:58:38 +0000 (UTC) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com [209.85.217.177]) by lists.linaro.org (Postfix) with ESMTPS id 5F86761D2F for ; Mon, 13 Apr 2015 20:58:37 +0000 (UTC) Received: by lbbzk7 with SMTP id zk7so69392551lbb.0 for ; Mon, 13 Apr 2015 13:58:36 -0700 (PDT) X-Received: by 10.112.119.163 with SMTP id kv3mr15151625lbb.101.1428958715989; Mon, 13 Apr 2015 13:58:35 -0700 (PDT) Received: from localhost.localdomain (78-82-118-95.tn.glocalnet.net. [78.82.118.95]) by mx.google.com with ESMTPSA id f7sm1916434lam.17.2015.04.13.13.58.34 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 13 Apr 2015 13:58:35 -0700 (PDT) From: Ola Liljedahl To: lng-odp@lists.linaro.org Date: Mon, 13 Apr 2015 22:58:29 +0200 Message-Id: <1428958709-11298-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.180 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 Reviewed-by: Mike Holmes --- (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; }