diff options
-rw-r--r-- | drivers/block/floppy.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 8f5565bf34cd..12251a688871 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c | |||
@@ -3121,10 +3121,11 @@ loop: | |||
3121 | return -ENOMEM; | 3121 | return -ENOMEM; |
3122 | *rcmd = ptr; | 3122 | *rcmd = ptr; |
3123 | ret = copy_from_user(ptr, param, sizeof(*ptr)); | 3123 | ret = copy_from_user(ptr, param, sizeof(*ptr)); |
3124 | if (ret) | ||
3125 | return -EFAULT; | ||
3126 | ptr->next = NULL; | 3124 | ptr->next = NULL; |
3127 | ptr->buffer_length = 0; | 3125 | ptr->buffer_length = 0; |
3126 | ptr->kernel_data = NULL; | ||
3127 | if (ret) | ||
3128 | return -EFAULT; | ||
3128 | param += sizeof(struct floppy_raw_cmd); | 3129 | param += sizeof(struct floppy_raw_cmd); |
3129 | if (ptr->cmd_count > 33) | 3130 | if (ptr->cmd_count > 33) |
3130 | /* the command may now also take up the space | 3131 | /* the command may now also take up the space |
@@ -3140,7 +3141,6 @@ loop: | |||
3140 | for (i = 0; i < 16; i++) | 3141 | for (i = 0; i < 16; i++) |
3141 | ptr->reply[i] = 0; | 3142 | ptr->reply[i] = 0; |
3142 | ptr->resultcode = 0; | 3143 | ptr->resultcode = 0; |
3143 | ptr->kernel_data = NULL; | ||
3144 | 3144 | ||
3145 | if (ptr->flags & (FD_RAW_READ | FD_RAW_WRITE)) { | 3145 | if (ptr->flags & (FD_RAW_READ | FD_RAW_WRITE)) { |
3146 | if (ptr->length <= 0) | 3146 | if (ptr->length <= 0) |