Re: + drivers-block-floppyc-remove-copyin-copyout-and-ecall-macros.patchadded to -mm tree

From: Jiri Slaby
Date: Wed Jan 27 2010 - 04:43:38 EST


On 01/27/2010 01:37 AM, akpm@xxxxxxxxxxxxxxxxxxxx wrote:
> @@ -3145,7 +3136,9 @@ static inline int raw_cmd_copyout(int cm
> int ret;
>
> while (ptr) {
> - COPYOUT(*ptr);
> + ret = copy_to_user((void __user *)param, ptr, sizeof(*ptr));
> + if (ret)
> + return -EFAULT;
> param += sizeof(struct floppy_raw_cmd);
> if ((ptr->flags & FD_RAW_READ) && ptr->buffer_length) {
> if (ptr->length >= 0 &&
> @@ -3195,7 +3188,9 @@ static inline int raw_cmd_copyin(int cmd
> if (!ptr)
> return -ENOMEM;
> *rcmd = ptr;
> - COPYIN(*ptr);
> + ret = copy_from_user(ptr, (void __user *)param, sizeof(*ptr));

Actually the casts are not needed anymore, are they?

--
js
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/