Received: from eggs.gnu.org ([2001:4830:134:3::10]:59496) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwZPO-0007Y1-Vl for qemu-devel@nongnu.org; Tue, 18 Oct 2016 14:46:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bwZPO-000560-Dt for qemu-devel@nongnu.org; Tue, 18 Oct 2016 14:46:43 -0400 Date: Wed, 19 Oct 2016 00:16:26 +0530 (IST) From: P J P In-Reply-To: Message-ID: References: <1476784025-27293-1-git-send-email-ppandit@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Subject: Re: [Qemu-devel] [Qemu-arm] [PATCH] char: cadence: check divider against baud rate List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Qemu Developers , qemu-arm , Huawei PSIRT , Alistair Francis +-- On Tue, 18 Oct 2016, Peter Maydell wrote --+ | > + if (!s->r[R_BRGR] || !(s->r[R_BDIV] + 1) | > + || baud_rate < (s->r[R_BRGR] * (s->r[R_BDIV] + 1))) { | > + return; | > + } | > ssp.speed = baud_rate / (s->r[R_BRGR] * (s->r[R_BDIV] + 1)); | > packet_size = 1; | | It seems really unlikely that early return here is the correct thing, since | it will result in our not correctly setting a bunch of the other | stuff done later in this function that's unrelated to baud rate. | What does the datasheet for this UART specify for this situation? @Alistair.. wdyt? -- Prasad J Pandit / Red Hat Product Security Team 47AF CE69 3A90 54AA 9045 1053 DD13 3D32 FE5B 041F