From patchwork Tue Aug 28 11:59:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1381201 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id DADB6DF283 for ; Tue, 28 Aug 2012 12:00:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752297Ab2H1L7t (ORCPT ); Tue, 28 Aug 2012 07:59:49 -0400 Received: from mail-gg0-f174.google.com ([209.85.161.174]:56188 "EHLO mail-gg0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751202Ab2H1L7q (ORCPT ); Tue, 28 Aug 2012 07:59:46 -0400 Received: by mail-gg0-f174.google.com with SMTP id k6so1052776ggd.19 for ; Tue, 28 Aug 2012 04:59:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=PGz1OMB6sk5eSMIUoSGtrvH5CehreegOeELpyScJxno=; b=x6Kb0Ypl+XfWfXE04Ui0jiQ3Gji+fTGglE6gQxQdSfnOkiHJMM6Ol8lxSt38UHf5sL NiayTQ6Oy3kGHVNfJbwmxmKAHolqP1yWNcgC5m9SJCVami1FzbjBrE+F0OdQpiUe0GHJ imMGcIIaD5Z6MhaKp1pBh7zie02B9rMAWEiKRfqdYJN+1IU+HaseQzIrXzrvWMfOpAVW c2C5rxpjBWEBhIPBwR0hbGGn4d+J9SaXDEMeY5SbfYpDPlA2KmTBr9bKixFXy0tL6MnE XuIOecpkc/jbJlh6mEp/WzX6p1jb7H0BhdSmpn/QTeCGeYGb/zSxdT2oXeAV+7foFXsz LgBQ== Received: by 10.236.180.42 with SMTP id i30mr13474411yhm.89.1346155186215; Tue, 28 Aug 2012 04:59:46 -0700 (PDT) Received: from yakj.usersys.redhat.com (93-34-169-1.ip50.fastwebnet.it. [93.34.169.1]) by mx.google.com with ESMTPS id s17sm19467651anj.13.2012.08.28.04.59.38 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 28 Aug 2012 04:59:45 -0700 (PDT) From: Paolo Bonzini To: linux-kernel@vger.kernel.org Cc: linux-scsi@vger.kernel.org, kvm@vger.kernel.org, jbottomley@parallels.com, "Richard W.M. Jones" Subject: [PATCH for 3.6 2/3] virtio-scsi: initialize scatterlist structure for events Date: Tue, 28 Aug 2012 13:59:13 +0200 Message-Id: <1346155154-12915-3-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.7.11.2 In-Reply-To: <1346155154-12915-1-git-send-email-pbonzini@redhat.com> References: <1346155154-12915-1-git-send-email-pbonzini@redhat.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Richard W.M. Jones The sg struct for events is used without being initialized. This triggers a BUG_ON if CONFIG_DEBUG_SG is defined. This was reported at https://bugzilla.redhat.com/show_bug.cgi?id=847548. Signed-off-by: Richard W.M. Jones Signed-off-by: Paolo Bonzini --- drivers/scsi/virtio_scsi.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index 3e79a2f..7554d78 100644 --- a/drivers/scsi/virtio_scsi.c +++ b/drivers/scsi/virtio_scsi.c @@ -219,7 +219,7 @@ static int virtscsi_kick_event(struct virtio_scsi *vscsi, struct scatterlist sg; unsigned long flags; - sg_set_buf(&sg, &event_node->event, sizeof(struct virtio_scsi_event)); + sg_init_one(&sg, &event_node->event, sizeof(struct virtio_scsi_event)); spin_lock_irqsave(&vscsi->event_vq.vq_lock, flags);