Message ID | 20170106140320.2476-1-tomeu.vizoso@collabora.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <intel-gfx-bounces@lists.freedesktop.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8647E606B4 for <patchwork-intel-gfx@patchwork.kernel.org>; Fri, 6 Jan 2017 14:03:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D8FB1FE6A for <patchwork-intel-gfx@patchwork.kernel.org>; Fri, 6 Jan 2017 14:03:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7E3CE284C2; Fri, 6 Jan 2017 14:03:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0A0EA1FE6A for <patchwork-intel-gfx@patchwork.kernel.org>; Fri, 6 Jan 2017 14:03:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 573376E9FE; Fri, 6 Jan 2017 14:03:47 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 255EF6E9FE for <intel-gfx@lists.freedesktop.org>; Fri, 6 Jan 2017 14:03:45 +0000 (UTC) Received: by mail-wm0-x242.google.com with SMTP id c85so5196513wmi.1 for <intel-gfx@lists.freedesktop.org>; Fri, 06 Jan 2017 06:03:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=1JtSuU8NmpxvG8qzIZw167GC1OXao6pCzIs6+WWJF5g=; b=fLAM48+cWDaBXT9iFjD0CDtgVsFpxPBP6EdYGz51fP2VUsxTTFphWOJm3hVMqqplr9 BpDlk1linhEY7bxbu5ZVcAMXmXwg3Ako4f3nQ0PagdZo8tln8c53R73doE/sKVEAgKB0 vJdomnoVWEPobkG1q2jSmV9Jey0aqUa+lmgtleSQSP4j+DGjpAQ+uTsdNFP1uA9yfsRb GyMIu2ne5XRRnFIWQq84KUm7OwFyi17ZpsgN0SndDFawTDe/gbFJvTeo6/0yjtrPnJBp /FWTQDwjKFb95VkTofemK/fYkAzbWjnneQ/2Z07pZrAxMRdPDcuWCf5BkSnGLqMY+Nne 88vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=1JtSuU8NmpxvG8qzIZw167GC1OXao6pCzIs6+WWJF5g=; b=c229uOjEG0x1iEcjfHiN65goUA1DRMLD4uK7OXTQ9A2C3LUnb7vMOagB4SOC4sEFco MGY8mJeAtWSlEkjcJLADpOfnvil8MAv/W1a8mVuQ5aKnTySerlbWqGernfkvVyt2JcqW eCY+S/5pFywbzOSC2QBFCRMf//yA2ExAhHU/L4VuZ9nzt5Z7+oKBf6Y5L3giPm2dnmLx qdtKQCHZrfNKKl2Ta4PEbSZv85qeVy3Ot1P/E0MovqlzpCyp1Q11c2mZyTywcw/TtU0b x14S0pg0yhGyr8JjlOWBIMcPAGnd04ZfjUmdhGzwUdV8hq9lGQp3/bfiCjkZrpP6xJo7 dQfg== X-Gm-Message-State: AIkVDXKQwuiMkfrNoWQ5ChUZm4k6ulpsDu2y7Xb6+MUNLnc4KgbWztgef58xir1IyvUb9A== X-Received: by 10.28.159.143 with SMTP id i137mr3544904wme.75.1483711423159; Fri, 06 Jan 2017 06:03:43 -0800 (PST) Received: from cizrna.lan ([109.72.12.216]) by smtp.gmail.com with ESMTPSA id 6sm108693280wjt.5.2017.01.06.06.03.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Jan 2017 06:03:41 -0800 (PST) From: Tomeu Vizoso <tomeu.vizoso@collabora.com> To: Intel GFX discussion <intel-gfx@lists.freedesktop.org> Date: Fri, 6 Jan 2017 15:03:20 +0100 Message-Id: <20170106140320.2476-1-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.9.3 Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com> Subject: [Intel-gfx] [PATCH i-g-t] lib: Make sure we don't use a negative offset X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development <intel-gfx.lists.freedesktop.org> List-Unsubscribe: <https://lists.freedesktop.org/mailman/options/intel-gfx>, <mailto:intel-gfx-request@lists.freedesktop.org?subject=unsubscribe> List-Archive: <https://lists.freedesktop.org/archives/intel-gfx> List-Post: <mailto:intel-gfx@lists.freedesktop.org> List-Help: <mailto:intel-gfx-request@lists.freedesktop.org?subject=help> List-Subscribe: <https://lists.freedesktop.org/mailman/listinfo/intel-gfx>, <mailto:intel-gfx-request@lists.freedesktop.org?subject=subscribe> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" <intel-gfx-bounces@lists.freedesktop.org> X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c index d828687a62ca..b1b67e740041 100644 --- a/lib/igt_debugfs.c +++ b/lib/igt_debugfs.c @@ -601,6 +601,7 @@ static int read_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out) igt_assert(pipe_crc->flags & O_NONBLOCK); bytes_read = 0; } + igt_assert_lte(0, bytes_read); buf[bytes_read] = '\0'; if (bytes_read && !pipe_crc_init_from_string(pipe_crc, out, buf))
As bytes_read can contain an error condition under some circumstances, in which we want to error out. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> --- lib/igt_debugfs.c | 1 + 1 file changed, 1 insertion(+)