On Thu, May 01 2008 at 17:56 +0300, Boaz Harrosh <bharrosh@xxxxxxxxxxx> wrote: > > --- > From: Boaz Harrosh <bharrosh@xxxxxxxxxxx> > Subject: [PATCH 4/4] gdth: Use scsi_allocate_command for private command allocation > > In gdth_execute() use scsi_allocate_command for allocation of > a command. To be insulated from future scsi_cmnd construction > considerations. > > Signed-off-by: Boaz Harrosh <bharrosh@xxxxxxxxxxx> > --- <snip> Rrrr wrong patch sorry for the noise. Here is a compiling one --- From: Boaz Harrosh <bharrosh@xxxxxxxxxxx> Subject: [PATCH] gdth: Use scsi_get_command for private command allocation In gdth_execute() use scsi_get_command for allocation of a command. To be insulated from future scsi_cmnd construction considerations. Signed-off-by: Boaz Harrosh <bharrosh@xxxxxxxxxxx> --- drivers/scsi/gdth.c | 13 +++---------- 1 files changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c index 35ad3bf..3cfbab6 100644 --- a/drivers/scsi/gdth.c +++ b/drivers/scsi/gdth.c @@ -447,17 +447,10 @@ int gdth_execute(gdth_ha_str *ha, gdth_cmd_str *gdtcmd, char *cmnd, DECLARE_COMPLETION_ONSTACK(wait); int rval; - scp = kzalloc(sizeof(*scp), GFP_KERNEL); + scp = scsi_get_command(ha->sdev, GFP_KERNEL); if (!scp) return -ENOMEM; - scp->sense_buffer = kzalloc(SCSI_SENSE_BUFFERSIZE, GFP_KERNEL); - if (!scp->sense_buffer) { - kfree(scp); - return -ENOMEM; - } - - scp->device = ha->sdev; memset(&cmndinfo, 0, sizeof(cmndinfo)); /* use request field to save the ptr. to completion struct. */ @@ -477,8 +470,8 @@ int gdth_execute(gdth_ha_str *ha, gdth_cmd_str *gdtcmd, char *cmnd, rval = cmndinfo.status; if (info) *info = cmndinfo.info; - kfree(scp->sense_buffer); - kfree(scp); + + scsi_put_command(scp); return rval; } -- 1.5.3.3 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html