Skip to content

Commit

Permalink
Staging: hv: storvsc: Fix a bug in storvsc_command_completion()
Browse files Browse the repository at this point in the history
Fix a bug in storvsc_command_completion() that leaks memory when scatter/gather
lists are used on the "write" side.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
K. Y. Srinivasan authored and Greg Kroah-Hartman committed Dec 1, 2011
1 parent 2781866 commit a768a76
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/staging/hv/storvsc_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1123,13 +1123,12 @@ static void storvsc_command_completion(struct hv_storvsc_request *request)

vm_srb = &request->vstor_packet.vm_srb;
if (cmd_request->bounce_sgl_count) {
if (vm_srb->data_in == READ_TYPE) {
if (vm_srb->data_in == READ_TYPE)
copy_from_bounce_buffer(scsi_sglist(scmnd),
cmd_request->bounce_sgl,
scsi_sg_count(scmnd));
destroy_bounce_buffer(cmd_request->bounce_sgl,
destroy_bounce_buffer(cmd_request->bounce_sgl,
cmd_request->bounce_sgl_count);
}
}

/*
Expand Down

0 comments on commit a768a76

Please sign in to comment.