Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2662442imj; Mon, 11 Feb 2019 06:39:24 -0800 (PST) X-Google-Smtp-Source: AHgI3IYCq6HCXKwHX6AGKgMa35HhlRnS8380Z3nfl/MTEnS/9Pvl05T+PpTZF4KWZlWI/AJ+dAg+ X-Received: by 2002:a63:d005:: with SMTP id z5mr33588740pgf.64.1549895964862; Mon, 11 Feb 2019 06:39:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549895964; cv=none; d=google.com; s=arc-20160816; b=ByW3opCgOQ4QRQ+yw2JgD2XUvucrdm9MPEZ1EauGlLzsKn72aslxSCH3x6FMojlLGE iCw44C6EDHAqLj/3lDZqP3Zi4kfmU+1Qh2CH4+Go+iAaJNNXe+mv1imEGF+AQd80idMt d1SSHCWDG7cnFuDRD/b4ZjBQSVQ1HxQ7G2cOmFc8ks+WRLjcnS4Yanq8Xw4yQoQ40Z99 CiB4psVEdIDrslSoNrSn+TjG/IWUP3cR8fjD5KU+iveBpN+w4rMt0A5c+Hn2ogqZ8lhT oW2TlnTs7TqgScOuhWNvdFtdgpdSmMz42iKAzr9gBsTGFlQ4T8lQEJe4JOYVuwEgtShD RvOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qlROFrd65PEdB12AWzVoy3SPzwlytuPXqmWVE6LdrqI=; b=Z2qh8M0VG6qZ6jAmD4u48yCJzpCe/VkoL9d0hWv42+su6f8X8nUSCi7liYgNdiE3Le +k2CjnPUe2oQtDB+WqiWPZnm/M1d/7TsuLamRVSq1pSGabFJaqp4gLWdNt9opiyBlRpd 77JJVb0WUg3NpyLSy88RrIK3/9YsLOH00jLHPgphluXMetY5R3z5KV0k0nr9V31R/hQg BHmkzN3cMzwsEVl6ahgPad0iNpkmvoP+WrLOs7QTmY5A0PfillRWR13I5WS9kISF3Nv1 vnDDRufhQUl1gM4BnJDccV+kk2cBKxNcw8jlRmd5veXzhCvSz3/hqaJLOmOFpIejU3XY Mm5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="VZfA/TsP"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t5si8932319pgu.52.2019.02.11.06.39.08; Mon, 11 Feb 2019 06:39:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="VZfA/TsP"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731640AbfBKOiR (ORCPT + 99 others); Mon, 11 Feb 2019 09:38:17 -0500 Received: from mail.kernel.org ([198.145.29.99]:47938 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731631AbfBKOiP (ORCPT ); Mon, 11 Feb 2019 09:38:15 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 84FFB222A2; Mon, 11 Feb 2019 14:38:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895895; bh=S4o7OIj/57ayV9M8bZ+wqRjqRphTcrD61lu22oS85qQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VZfA/TsP1mUFE6hxrWjrcxseHCB4DgTs8iR0bBeDrr1z67ZOgp4oPXyJkVLrqhadE fUmMWkEzzE/FaqB56QE44/QwW0i83fGg+rdhaFLOSKqhLXE+9BR1iQE95l4/f9P3sT DewKMa25Iwrb4uSphd91affzQaWU4oZcZv6XkKek= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Gustavo A. R. Silva" , Jiri Olsa , Alexander Shishkin , Namhyung Kim , Peter Zijlstra , Arnaldo Carvalho de Melo Subject: [PATCH 4.20 347/352] perf tests evsel-tp-sched: Fix bitwise operator Date: Mon, 11 Feb 2019 15:19:34 +0100 Message-Id: <20190211141909.252984338@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ From: Gustavo A. R. Silva commit 489338a717a0dfbbd5a3fabccf172b78f0ac9015 upstream. Notice that the use of the bitwise OR operator '|' always leads to true in this particular case, which seems a bit suspicious due to the context in which this expression is being used. Fix this by using bitwise AND operator '&' instead. This bug was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: stable@vger.kernel.org Fixes: 6a6cd11d4e57 ("perf test: Add test for the sched tracepoint format fields") Link: http://lkml.kernel.org/r/20190122233439.GA5868@embeddedor Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Greg Kroah-Hartman --- tools/perf/tests/evsel-tp-sched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/tools/perf/tests/evsel-tp-sched.c +++ b/tools/perf/tests/evsel-tp-sched.c @@ -17,7 +17,7 @@ static int perf_evsel__test_field(struct return -1; } - is_signed = !!(field->flags | TEP_FIELD_IS_SIGNED); + is_signed = !!(field->flags & TEP_FIELD_IS_SIGNED); if (should_be_signed && !is_signed) { pr_debug("%s: \"%s\" signedness(%d) is wrong, should be %d\n", evsel->name, name, is_signed, should_be_signed);