From patchwork Wed Jan 14 12:11:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ola Liljedahl X-Patchwork-Id: 43102 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f197.google.com (mail-we0-f197.google.com [74.125.82.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 32D1620D60 for ; Wed, 14 Jan 2015 12:11:31 +0000 (UTC) Received: by mail-we0-f197.google.com with SMTP id w61sf4652848wes.0 for ; Wed, 14 Jan 2015 04:11:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state: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=vu1BVun/N1ilKYzmqPLLcepBsSbSmnR973utnfFo1Iw=; b=WYzaYP9LPKZ5GeksKXH0tdxkgDw5sodvwb/lwxZpfYbXywHtffR9ZnSEUgPp4R3cCm mq8eK5KjMCHMjJRVnDVPb0ULplr8Ct4jURvTOZYKQ0PNVZJmC61uMp+cl2VYwfxlF2LX MY46/HzDgBOppKIJ67paGyc311uG1UVAfFjKUUpcuhrkgc0tORrgY++zAsqj9GvG8dO4 CV8PgqLTasQvO4RST/AojYlmQmg5Op/m3S1MLOsIWZW0LBAQ5lgLWBCSEZOWmGUwnWtY pSNCx7xNKYeWcyc5Je/sIYPpFuW1IF42BqqWlcEBpNddMrw6Te3RgWU6O2iBb4CXRFzk V9cg== X-Gm-Message-State: ALoCoQnoghDXQksGNmAbjGMoXaStsk759U/mTNmQNbDUn5GFhaTE9NKcpIA+zMQ6JBgYucbhjV0N X-Received: by 10.180.19.42 with SMTP id b10mr3566980wie.0.1421237490380; Wed, 14 Jan 2015 04:11:30 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.98 with SMTP id l2ls103804laf.73.gmail; Wed, 14 Jan 2015 04:11:30 -0800 (PST) X-Received: by 10.112.222.135 with SMTP id qm7mr3538466lbc.19.1421237490217; Wed, 14 Jan 2015 04:11:30 -0800 (PST) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com. [209.85.215.43]) by mx.google.com with ESMTPS id rz1si27094668lbb.42.2015.01.14.04.11.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 14 Jan 2015 04:11:30 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) client-ip=209.85.215.43; Received: by mail-la0-f43.google.com with SMTP id s18so7735217lam.2 for ; Wed, 14 Jan 2015 04:11:30 -0800 (PST) X-Received: by 10.112.131.1 with SMTP id oi1mr3628550lbb.2.1421237490090; Wed, 14 Jan 2015 04:11:30 -0800 (PST) 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.9.200 with SMTP id c8csp1675278lbb; Wed, 14 Jan 2015 04:11:29 -0800 (PST) X-Received: by 10.140.100.248 with SMTP id s111mr5771997qge.44.1421237488860; Wed, 14 Jan 2015 04:11:28 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id l17si30745183qgd.62.2015.01.14.04.11.27 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 14 Jan 2015 04:11:28 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YBMnF-0006Xm-HJ; Wed, 14 Jan 2015 12:11:25 +0000 Received: from mail-lb0-f178.google.com ([209.85.217.178]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1YBMnA-0006XX-5F for lng-odp@lists.linaro.org; Wed, 14 Jan 2015 12:11:20 +0000 Received: by mail-lb0-f178.google.com with SMTP id u14so7519777lbd.9 for ; Wed, 14 Jan 2015 04:11:14 -0800 (PST) X-Received: by 10.152.203.201 with SMTP id ks9mr3462258lac.57.1421237474187; Wed, 14 Jan 2015 04:11:14 -0800 (PST) Received: from macmini.lan (78-82-118-111.tn.glocalnet.net. [78.82.118.111]) by mx.google.com with ESMTPSA id mc17sm5836563lbb.1.2015.01.14.04.11.13 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 14 Jan 2015 04:11:13 -0800 (PST) From: Ola Liljedahl To: lng-odp@lists.linaro.org Date: Wed, 14 Jan 2015 13:11:11 +0100 Message-Id: <1421237471-25485-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: odp_timer.c: timer_settime usage bug X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 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-bounces@lists.linaro.org 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.215.43 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 Timerid is passed by value, not reference. Compiler cannot detect this problem because timer_t is defined as a void ptr on Linux. Signed-off-by: Ola Liljedahl Reviewed-by: Bill Fischofer --- (This document/code contribution attached is provided under the terms of agreement LES-LTM-21309) Broken code worked anyway on x86-64 and ARMv7 targets but bug was detected on i386 target or -m32 build on x86-64 target. platform/linux-generic/odp_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/linux-generic/odp_timer.c b/platform/linux-generic/odp_timer.c index ef26b02..3ba32a1 100644 --- a/platform/linux-generic/odp_timer.c +++ b/platform/linux-generic/odp_timer.c @@ -659,7 +659,7 @@ static void itimer_init(odp_timer_pool *tp) ispec.it_value.tv_sec = (time_t)sec; ispec.it_value.tv_nsec = (long)nsec; - if (timer_settime(&tp->timerid, 0, &ispec, NULL)) + if (timer_settime(tp->timerid, 0, &ispec, NULL)) ODP_ABORT("timer_settime() returned error %s\n", strerror(errno)); }