diff options
Diffstat (limited to 'drivers/block/floppy.c')
-rw-r--r-- | drivers/block/floppy.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 46536b716acc..4807203827cc 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c | |||
@@ -3104,13 +3104,13 @@ static struct cont_t raw_cmd_cont = { | |||
3104 | .done = raw_cmd_done | 3104 | .done = raw_cmd_done |
3105 | }; | 3105 | }; |
3106 | 3106 | ||
3107 | static inline int raw_cmd_copyout(int cmd, char __user *param, | 3107 | static inline int raw_cmd_copyout(int cmd, void __user *param, |
3108 | struct floppy_raw_cmd *ptr) | 3108 | struct floppy_raw_cmd *ptr) |
3109 | { | 3109 | { |
3110 | int ret; | 3110 | int ret; |
3111 | 3111 | ||
3112 | while (ptr) { | 3112 | while (ptr) { |
3113 | ret = copy_to_user((void __user *)param, ptr, sizeof(*ptr)); | 3113 | ret = copy_to_user(param, ptr, sizeof(*ptr)); |
3114 | if (ret) | 3114 | if (ret) |
3115 | return -EFAULT; | 3115 | return -EFAULT; |
3116 | param += sizeof(struct floppy_raw_cmd); | 3116 | param += sizeof(struct floppy_raw_cmd); |
@@ -3148,7 +3148,7 @@ static void raw_cmd_free(struct floppy_raw_cmd **ptr) | |||
3148 | } | 3148 | } |
3149 | } | 3149 | } |
3150 | 3150 | ||
3151 | static inline int raw_cmd_copyin(int cmd, char __user *param, | 3151 | static inline int raw_cmd_copyin(int cmd, void __user *param, |
3152 | struct floppy_raw_cmd **rcmd) | 3152 | struct floppy_raw_cmd **rcmd) |
3153 | { | 3153 | { |
3154 | struct floppy_raw_cmd *ptr; | 3154 | struct floppy_raw_cmd *ptr; |
@@ -3157,12 +3157,11 @@ static inline int raw_cmd_copyin(int cmd, char __user *param, | |||
3157 | 3157 | ||
3158 | *rcmd = NULL; | 3158 | *rcmd = NULL; |
3159 | while (1) { | 3159 | while (1) { |
3160 | ptr = (struct floppy_raw_cmd *) | 3160 | ptr = kmalloc(sizeof(struct floppy_raw_cmd), GFP_USER); |
3161 | kmalloc(sizeof(struct floppy_raw_cmd), GFP_USER); | ||
3162 | if (!ptr) | 3161 | if (!ptr) |
3163 | return -ENOMEM; | 3162 | return -ENOMEM; |
3164 | *rcmd = ptr; | 3163 | *rcmd = ptr; |
3165 | ret = copy_from_user(ptr, (void __user *)param, sizeof(*ptr)); | 3164 | ret = copy_from_user(ptr, param, sizeof(*ptr)); |
3166 | if (ret) | 3165 | if (ret) |
3167 | return -EFAULT; | 3166 | return -EFAULT; |
3168 | ptr->next = NULL; | 3167 | ptr->next = NULL; |