Skip to content

Commit

Permalink
[SCSI] virtio-scsi: initialize scatterlist structure
Browse files Browse the repository at this point in the history
The sg struct is used without being initialized, which breaks
when CONFIG_DEBUG_SG is enabled.

Cc: stable@vger.kernel.org
Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
  • Loading branch information
Richard W.M. Jones authored and James Bottomley committed Oct 9, 2012
1 parent ae59057 commit 2e9c9df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/scsi/virtio_scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 2e9c9df

Please sign in to comment.