Received: from eggs.gnu.org ([2001:4830:134:3::10]:57859) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c5BEx-0007CX-V7 for qemu-devel@nongnu.org; Fri, 11 Nov 2016 07:47:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c5BEt-0004uU-2O for qemu-devel@nongnu.org; Fri, 11 Nov 2016 07:47:31 -0500 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:36156) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c5BEs-0004st-Pv for qemu-devel@nongnu.org; Fri, 11 Nov 2016 07:47:26 -0500 Received: by mail-wm0-x241.google.com with SMTP id m203so7592916wma.3 for ; Fri, 11 Nov 2016 04:47:26 -0800 (PST) Date: Fri, 11 Nov 2016 12:47:23 +0000 From: Stefan Hajnoczi Message-ID: <20161111124723.GC8930@stefanha-x1.localdomain> References: <20161110152751.4267-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Fig2xvG2VGoz8o/s" Content-Disposition: inline In-Reply-To: <20161110152751.4267-1-pbonzini@redhat.com> Subject: Re: [Qemu-devel] [PATCH for-2.8] megasas: do not call pci_dma_unmap after having freed the frame once List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org --Fig2xvG2VGoz8o/s Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 10, 2016 at 04:27:50PM +0100, Paolo Bonzini wrote: > Commit 8cc4678 ("megasas: remove useless check for cmd->frame", 2016-07-1= 7) was > wrong because I trusted Coverity too much. It turns out that there _is_ a > path through which cmd->frame can become NULL. After megasas_handle_fram= e's > switch (md->frame->header.frame_cmd), megasas_init_firmware can be called. > From there, megasas_reset_frames will call megasas_unmap_frame which rese= ts > cmd->frame =3D NULL. >=20 > However, there is another bug to fix in there, because megasas_unmap_frame > is called again after setting the command status. In this case QEMU shou= ld > not do anything, instead it calls pci_dma_unmap again. Harmless, but > better fix it. >=20 > Signed-off-by: Paolo Bonzini > --- > hw/scsi/megasas.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) Reviewed-by: Stefan Hajnoczi --Fig2xvG2VGoz8o/s Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJYJb3bAAoJEJykq7OBq3PIMtoH/1XjmClK/dcXhCTN1gvVetCT gq+UBwPxLBQHriaCy/JqBE9eRynhhCvuvEx5Hh46DzboXEvQyQ5+vE1rQmGGvDXD xlmQ46PFNvsjqMx3q5giKknEd05c2H42GOHXlMcUotMLVBL9AeeKq35gTbhhuVqa 0yCf0723CB+OCldHhXfzz0b9uP7yDRmUbrJX8x63r2icITep02SgNKpaZYdilds6 PxrhuL5tcpPcAKDVRAAbDKmhUcjEQxcG9EifWh5QJ6kxrdcA5o3QWoKHzbM0yaKG EHkKnEJ0y0gSEvQPZT4ZseFd8xd9Qn/gqd18QvrrWVqfFuVZgg9pMvqisP3MaLM= =O6Sy -----END PGP SIGNATURE----- --Fig2xvG2VGoz8o/s--