Re: [PATCH -mm] idetape gcc 4.1 warning fix

From: Alan Cox
Date: Wed May 10 2006 - 06:29:58 EST


On Maw, 2006-05-09 at 19:55 -0700, Daniel Walker wrote:
> Fixes the following warning,
>
> drivers/ide/ide-tape.c: In function âidetape_copy_stage_from_userâ:
> drivers/ide/ide-tape.c:2662: warning: ignoring return value of âcopy_from_userâ, declared with attribute warn_unused_result
> drivers/ide/ide-tape.c: In function âidetape_copy_stage_to_userâ:

> count = min((unsigned int)(bh->b_size - atomic_read(&bh->b_count)), (unsigned int)n);
> - copy_from_user(bh->b_data + atomic_read(&bh->b_count), buf, count);
> + WARN_ON(copy_from_user(bh->b_data + atomic_read(&bh->b_count), buf, count));

So you want to let users spew all over the kernel log when a copy from
user fails. Either fix it properly or leave it alone. In this case its
actually quite hard to fix properly which is why it hasn't been done.

(POSIX doesn't require invalid addresses reliably report -EFAULT)

-
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/