Message ID | 1425305616-19656-1-git-send-email-daniel.thompson@linaro.org |
---|---|
State | Accepted |
Commit | c07d35338081d107e57cf37572d8cc931a8e32e2 |
Headers | show
Return-Path: <patchwork-forward+bncBCAPDLF44QLBBFPA2GTQKGQE5VQGKBQ@linaro.org> X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C3B452149C for <linaro@patches.linaro.org>; Mon, 2 Mar 2015 14:13:42 +0000 (UTC) Received: by lbiv13 with SMTP id v13sf7051760lbi.1 for <linaro@patches.linaro.org>; Mon, 02 Mar 2015 06:13:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=Jv/8w0Lvx9kGqlnWMebxQZU129GqJas7XQlKpdpe+gc=; b=FbgZ023FFoPgdWRg4HOmXxgLE6ajxRBqOdncVa4v6L2x+/xR6B9UaJH1dIQSK+KVi0 UPD/cFZmGYxBGkWZHXR45jBG9zvBO4YRDmSha5ciTYn36kcSNOL15gbk/+kSCxcShcX5 MaGvfxoHI+PcfzFOqNgWC/FA//D66pNlzhB6GpnWLaIumqLvNIbKF36bqCNLnC96uFus NG77N6xUX4uaDcZ3bqhxtAc0Wd1OSObQPwk8COP4N8dIrPnlXb4C1w15Ww6ZYZZcE3Ms pBJD724X1x8Q3Xf79J35UzwA6Evq4OaNrM+J0/AOHAgKe3WsgE0Y127hQvIOu3dMyGdx WGHg== X-Gm-Message-State: ALoCoQmt7UZFgFXmoJIUKalKtzVpMEhmD5wBtblO9fNnE5BHuQK1yO3lljOEamBlettlSNnMf82P X-Received: by 10.180.72.44 with SMTP id a12mr2234139wiv.0.1425305621763; Mon, 02 Mar 2015 06:13:41 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.115.180 with SMTP id jp20ls405135lab.64.gmail; Mon, 02 Mar 2015 06:13:41 -0800 (PST) X-Received: by 10.112.12.98 with SMTP id x2mr24275147lbb.3.1425305621574; Mon, 02 Mar 2015 06:13:41 -0800 (PST) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com. [209.85.215.41]) by mx.google.com with ESMTPS id xw3si2026091lbb.128.2015.03.02.06.13.41 for <patchwork-forward@linaro.org> (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Mar 2015 06:13:41 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) client-ip=209.85.215.41; Received: by labgq15 with SMTP id gq15so30553531lab.6 for <patchwork-forward@linaro.org>; Mon, 02 Mar 2015 06:13:41 -0800 (PST) X-Received: by 10.152.197.34 with SMTP id ir2mr24344640lac.36.1425305621306; Mon, 02 Mar 2015 06:13:41 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.35.133 with SMTP id h5csp5551147lbj; Mon, 2 Mar 2015 06:13:40 -0800 (PST) X-Received: by 10.180.198.162 with SMTP id jd2mr35339013wic.21.1425305620628; Mon, 02 Mar 2015 06:13:40 -0800 (PST) Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com. [209.85.212.174]) by mx.google.com with ESMTPS id e19si18762491wiw.44.2015.03.02.06.13.40 for <patches@linaro.org> (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Mar 2015 06:13:40 -0800 (PST) Received-SPF: pass (google.com: domain of daniel.thompson@linaro.org designates 209.85.212.174 as permitted sender) client-ip=209.85.212.174; Received: by wiwl15 with SMTP id l15so15127127wiw.3 for <patches@linaro.org>; Mon, 02 Mar 2015 06:13:40 -0800 (PST) X-Received: by 10.180.7.131 with SMTP id j3mr37046050wia.55.1425305620102; Mon, 02 Mar 2015 06:13:40 -0800 (PST) Received: from wychelm.lan (cpc4-aztw19-0-0-cust71.18-1.cable.virginm.net. [82.33.25.72]) by mx.google.com with ESMTPSA id q6sm16245139wix.13.2015.03.02.06.13.38 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Mar 2015 06:13:39 -0800 (PST) From: Daniel Thompson <daniel.thompson@linaro.org> To: Jason Wessel <jason.wessel@windriver.com> Cc: Daniel Thompson <daniel.thompson@linaro.org>, linux-kernel@vger.kernel.org, kgdb-bugreport@lists.sourceforge.net, Andrew Morton <akpm@linux-foundation.org>, Ingo Molnar <mingo@redhat.com>, patches@linaro.org, linaro-kernel@lists.linaro.org, John Stultz <john.stultz@linaro.org>, Sumit Semwal <sumit.semwal@linaro.org> Subject: [PATCH] kdb: Fix handling of kallsyms_symbol_next() return value Date: Mon, 2 Mar 2015 14:13:36 +0000 Message-Id: <1425305616-19656-1-git-send-email-daniel.thompson@linaro.org> X-Mailer: git-send-email 2.1.0 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: daniel.thompson@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.41 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: <patchwork-forward.linaro.org> X-Google-Group-Id: 836684582541 List-Post: <http://groups.google.com/a/linaro.org/group/patchwork-forward/post>, <mailto:patchwork-forward@linaro.org> List-Help: <http://support.google.com/a/linaro.org/bin/topic.py?topic=25838>, <mailto:patchwork-forward+help@linaro.org> List-Archive: <http://groups.google.com/a/linaro.org/group/patchwork-forward/> List-Unsubscribe: <mailto:googlegroups-manage+836684582541+unsubscribe@googlegroups.com>, <http://groups.google.com/a/linaro.org/group/patchwork-forward/subscribe> |
diff --git a/kernel/debug/kdb/kdb_io.c b/kernel/debug/kdb/kdb_io.c index fc1ef73..77777d9 100644 --- a/kernel/debug/kdb/kdb_io.c +++ b/kernel/debug/kdb/kdb_io.c @@ -349,7 +349,7 @@ poll_again: } kdb_printf("\n"); for (i = 0; i < count; i++) { - if (kallsyms_symbol_next(p_tmp, i) < 0) + if (WARN_ON(!kallsyms_symbol_next(p_tmp, i))) break; kdb_printf("%s ", p_tmp); *(p_tmp + len) = '\0';
kallsyms_symbol_next() returns a boolean (true on success). Currently kdb_read() tests the return value with an inequality that unconditionally evaluates to true. This is fixed in the obvious way and, since the conditional branch is supposed to be unreachable, we also add a WARN_ON(). Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org> --- kernel/debug/kdb/kdb_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.1.0