Re: [PATCH] telephony: fix return value

From: Jiri Kosina
Date: Fri Oct 29 2010 - 05:42:12 EST


On Tue, 26 Oct 2010, Nicolas Kaiser wrote:

> If copy_from_user fails, the return value gets overwritten.
>
> Signed-off-by: Nicolas Kaiser <nikai@xxxxxxxxx>
> ---
> drivers/telephony/ixj.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/telephony/ixj.c b/drivers/telephony/ixj.c
> index 0d236f4..2d1280a 100644
> --- a/drivers/telephony/ixj.c
> +++ b/drivers/telephony/ixj.c
> @@ -6581,7 +6581,8 @@ static long do_ixj_ioctl(struct file *file_p, unsigned int cmd, unsigned long ar
> case IXJCTL_SET_FILTER:
> if (copy_from_user(&jf, argp, sizeof(jf)))
> retval = -EFAULT;
> - retval = ixj_init_filter(j, &jf);
> + else
> + retval = ixj_init_filter(j, &jf);
> break;
> case IXJCTL_SET_FILTER_RAW:
> if (copy_from_user(&jfr, argp, sizeof(jfr)))

Applied, thanks Nicolas.

--
Jiri Kosina
SUSE Labs, Novell Inc.
--
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/