Message ID | 20190128175458.27255-20-minyard@acm.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BB0406C2 for <patchwork-qemu-devel@patchwork.kernel.org>; Mon, 28 Jan 2019 18:04:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A8ED42B54B for <patchwork-qemu-devel@patchwork.kernel.org>; Mon, 28 Jan 2019 18:04:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9D0962B588; Mon, 28 Jan 2019 18:04:17 +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=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BAE262B54B for <patchwork-qemu-devel@patchwork.kernel.org>; Mon, 28 Jan 2019 18:04:08 +0000 (UTC) Received: from localhost ([127.0.0.1]:36233 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org>) id 1goBGR-0005OK-Ts for patchwork-qemu-devel@patchwork.kernel.org; Mon, 28 Jan 2019 13:04:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37045) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <tcminyard@gmail.com>) id 1goBEB-0003Db-JP for qemu-devel@nongnu.org; Mon, 28 Jan 2019 13:01:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <tcminyard@gmail.com>) id 1goB8V-0005tq-AD for qemu-devel@nongnu.org; Mon, 28 Jan 2019 12:56:06 -0500 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]:40548) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from <tcminyard@gmail.com>) id 1goB8V-0005gC-0d for qemu-devel@nongnu.org; Mon, 28 Jan 2019 12:55:55 -0500 Received: by mail-pf1-x442.google.com with SMTP id i12so8329606pfo.7 for <qemu-devel@nongnu.org>; Mon, 28 Jan 2019 09:55:27 -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:in-reply-to:references; bh=vUBNL7iuL2tms8dcSHLWhPEfJJ8Hjvn6D7ICUweDvw0=; b=H6HtgR0pz1DUvhzywy1BzBCsYFiWEu5VFy+kYQpl1PGQcBBf/BS1f977d6bQZqn+SV dzoKuorLDsesmBIb1/4J5Je9hA4NrGFpyibbq1A43HeXfc53mcwCV8KarrjHU8pZOLky QE3TWmhyho3LYmC37qdS2vEkCKBRvnVMCTgvhmAKdBaT054aDuW6n2NmZjFoDPBlr3jY sshs+a0WPa6KKgAQwgx31wteb8ltpCx10Ozf996lbZ80JCDj8B+CKeAo4PIpeepW2oI7 HTbFebPg1yqwOIwz+T1E9oqbZ/I+9PTAycN7EBbBVpsaRwjp3SqB0PLkJMpkcraPYYFn 83Vw== 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 :in-reply-to:references; bh=vUBNL7iuL2tms8dcSHLWhPEfJJ8Hjvn6D7ICUweDvw0=; b=om205cV1CMZXDNM+BcS5woRZ5AFVOq4wo0zQeZkChF8H0bjVqsvyY2suNEnxkr0HzW 6pNIbUAW5TxfOs6TU2q2qhStVsviJpe8tj3PJv6lrKiRCE2AHKVK4S432KVuN0icuQcX S/HYTuxMdzQQLuhZVRaW0pHe2c8rRAGHJ++wlVzhPaBSFHRC+NLFH59AwZS7CC4PHKob JwAJwXooGd8wGZWi41J7NTdqL2DSMKmCBDRBdmec2QovEirydjr9qnuZ/GVw3LZ66izw Zaw/DPvboD292ubkzwVk8HLRBqnFtAmLhM7AVYKxz1WkddS25P8vLwBjKBI7/0P5k2nj gxkQ== X-Gm-Message-State: AJcUukcoiOqxo4YIJfPDp3ozOt/+xBMRmb9eBiz0urnZV5zuwuMSEv4H LZBO+Ih9+h2IBl4/I01zfw== X-Google-Smtp-Source: ALg8bN6lATP11VbTJ2VNksXq5yxZpGtPPD5O5++ycd6otljQ8QtNgu89xoB061AaD8Ih2c0tjkTT4A== X-Received: by 2002:a63:ed42:: with SMTP id m2mr20756223pgk.147.1548698126981; Mon, 28 Jan 2019 09:55:26 -0800 (PST) Received: from serve.minyard.net (serve.minyard.net. [2001:470:b8f6:1b::1]) by smtp.gmail.com with ESMTPSA id h82sm68862235pfa.105.2019.01.28.09.55.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Jan 2019 09:55:25 -0800 (PST) Received: from t430.minyard.net (unknown [IPv6:2001:470:b8f6:1b:c8f8:7971:e432:a838]) by serve.minyard.net (Postfix) with ESMTPA id 23BE7BEF; Mon, 28 Jan 2019 11:55:18 -0600 (CST) Received: by t430.minyard.net (Postfix, from userid 1000) id BAB4930052D; Mon, 28 Jan 2019 11:55:15 -0600 (CST) From: minyard@acm.org To: qemu-devel@nongnu.org, "Dr . David Alan Gilbert" <dgilbert@redhat.com> Date: Mon, 28 Jan 2019 11:54:58 -0600 Message-Id: <20190128175458.27255-20-minyard@acm.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190128175458.27255-1-minyard@acm.org> References: <20190128175458.27255-1-minyard@acm.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::442 Subject: [Qemu-devel] [PATCH v4 19/19] i2c: Verify that the count passed in to smbus_eeprom_init() is valid X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <http://lists.nongnu.org/archive/html/qemu-devel/> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: Peter Maydell <peter.maydell@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, Corey Minyard <cminyard@mvista.com>, Corey Minyard <minyard@acm.org>, "Michael S . Tsirkin" <mst@redhat.com> Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org> X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
Fix/add vmstate handling in some I2C code
|
expand
|
diff --git a/hw/i2c/smbus_eeprom.c b/hw/i2c/smbus_eeprom.c index 44887b4a27..ee392f7cb1 100644 --- a/hw/i2c/smbus_eeprom.c +++ b/hw/i2c/smbus_eeprom.c @@ -178,6 +178,8 @@ void smbus_eeprom_init(I2CBus *smbus, int nb_eeprom, { int i; /* XXX: make this persistent */ + + assert(nb_eeprom <= 8); uint8_t *eeprom_buf = g_malloc0(8 * SMBUS_EEPROM_SIZE); if (eeprom_spd_size > 0) { memcpy(eeprom_buf, eeprom_spd, eeprom_spd_size);