[{"id":1762835,"web_url":"http://patchwork.ozlabs.org/comment/1762835/","msgid":"<nycvar.YSQ.7.76.1709050001150.31255@wniryva>","list_archive_url":null,"date":"2017-09-04T18:37:02","subject":"Re: [Qemu-devel] [PATCH] wm8750: add record buffer underrun check","submitter":{"id":67408,"url":"http://patchwork.ozlabs.org/api/people/67408/","name":"Prasad Pandit","email":"ppandit@redhat.com"},"content":"+-- On Fri, 1 Sep 2017, Gerd Hoffmann wrote --+\n| diff --git a/hw/audio/wm8750.c b/hw/audio/wm8750.c\n| index f8b5bebfc2..d2bf2e1da1 100644\n| --- a/hw/audio/wm8750.c\n| +++ b/hw/audio/wm8750.c\n| @@ -680,8 +680,12 @@ uint32_t wm8750_adc_dat(void *opaque)\n|      WM8750State *s = (WM8750State *) opaque;\n|      uint32_t *data;\n|  \n| -    if (s->idx_in >= sizeof(s->data_in))\n| +    if (s->idx_in >= sizeof(s->data_in)) {\n|          wm8750_in_load(s);\n| +        if (s->idx_in >= sizeof(s->data_in)) {\n| +            return 0x80008000; /* silence in AUD_FMT_S16 sample format */\n| +        }\n| +    }\n|  \n|      data = (uint32_t *) &s->data_in[s->idx_in];\n|      s->req_in -= 4;\n\nAck, looks good. Thank you.\n--\nPrasad J Pandit / Red Hat Product Security Team\n47AF CE69 3A90 54AA 9045 1053 DD13 3D32 FE5B 041F","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx05.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx05.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=ppandit@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xmJVy535bz9sPs\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  5 Sep 2017 04:37:44 +1000 (AEST)","from localhost ([::1]:55203 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dowFi-0008PK-6y\n\tfor incoming@patchwork.ozlabs.org; Mon, 04 Sep 2017 14:37:42 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:56468)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <ppandit@redhat.com>) id 1dowFI-0008NB-Rv\n\tfor qemu-devel@nongnu.org; Mon, 04 Sep 2017 14:37:21 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <ppandit@redhat.com>) id 1dowFD-0005Zi-Rt\n\tfor qemu-devel@nongnu.org; Mon, 04 Sep 2017 14:37:16 -0400","from mx1.redhat.com ([209.132.183.28]:47962)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <ppandit@redhat.com>) id 1dowFD-0005Yz-LO\n\tfor qemu-devel@nongnu.org; Mon, 04 Sep 2017 14:37:11 -0400","from smtp.corp.redhat.com\n\t(int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id CC6882EC6B2\n\tfor <qemu-devel@nongnu.org>; Mon,  4 Sep 2017 18:37:09 +0000 (UTC)","from javelin (ovpn-204-62.brq.redhat.com [10.40.204.62])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id CC606820BF;\n\tMon,  4 Sep 2017 18:37:05 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com CC6882EC6B2","Date":"Tue, 5 Sep 2017 00:07:02 +0530 (IST)","From":"P J P <ppandit@redhat.com>","X-X-Sender":"pjp@javelin","To":"qemu-devel@nongnu.org","In-Reply-To":"<20170901131409.6712-1-kraxel@redhat.com>","Message-ID":"<nycvar.YSQ.7.76.1709050001150.31255@wniryva>","References":"<20170901131409.6712-1-kraxel@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=US-ASCII","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.16","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.29]);\n\tMon, 04 Sep 2017 18:37:10 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH] wm8750: add record buffer underrun check","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>,\n\t<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>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Gerd Hoffmann <kraxel@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]