[SCSI] Prevent scsi_execute_async from guessing cdb length
[powerpc.git] / drivers / scsi / st.c
index 6e4a36a..7f96f33 100644 (file)
@@ -194,7 +194,6 @@ static int sgl_unmap_user_pages(struct scatterlist *, const unsigned int, int);
 
 static int st_probe(struct device *);
 static int st_remove(struct device *);
-static int st_init_command(struct scsi_cmnd *);
 
 static void do_create_driverfs_files(void);
 static void do_remove_driverfs_files(void);
@@ -207,7 +206,6 @@ static struct scsi_driver st_template = {
                .probe          = st_probe,
                .remove         = st_remove,
        },
-       .init_command           = st_init_command,
 };
 
 static int st_compression(struct scsi_tape *, int);
@@ -510,7 +508,7 @@ st_do_scsi(struct st_request * SRpnt, struct scsi_tape * STp, unsigned char *cmd
        STp->buffer->cmdstat.have_sense = 0;
        STp->buffer->syscall_result = 0;
 
-       if (scsi_execute_async(STp->device, cmd, direction,
+       if (scsi_execute_async(STp->device, cmd, COMMAND_SIZE(cmd[0]), direction,
                        &((STp->buffer)->sg[0]), bytes, (STp->buffer)->sg_segs,
                               timeout, retries, SRpnt, st_sleep_done, GFP_KERNEL)) {
                /* could not allocate the buffer or request was too large */
@@ -4181,29 +4179,6 @@ static void scsi_tape_release(struct kref *kref)
        return;
 }
 
-static void st_intr(struct scsi_cmnd *SCpnt)
-{
-       /*
-        * The caller should be checking the request's errors
-        * value.
-        */
-       scsi_io_completion(SCpnt, SCpnt->bufflen, 0);
-}
-
-/*
- * st_init_command: only called via the scsi_cmd_ioctl (block SG_IO)
- * interface for REQ_BLOCK_PC commands.
- */
-static int st_init_command(struct scsi_cmnd *SCpnt)
-{
-       if (!(SCpnt->request->flags & REQ_BLOCK_PC))
-               return 0;
-
-       scsi_setup_blk_pc_cmnd(SCpnt);
-       SCpnt->done = st_intr;
-       return 1;
-}
-
 static int __init init_st(void)
 {
        validate_options();