[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1353040955.2337.82.camel@jtkirshe-mobl>
Date: Thu, 15 Nov 2012 20:42:35 -0800
From: Jeff Kirsher <jeffrey.t.kirsher@...el.com>
To: Cyril Roelandt <tipecaml@...il.com>
Cc: e1000-devel@...ts.sourceforge.net, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
"Hay, Joshua A" <joshua.a.hay@...el.com>,
Dan Carpenter <dan.carpenter@...cle.com>
Subject: Re: [PATCH] net/ethernet/intel/ixgbe/ixgbe_debugfs.c: fix error
handling in ixgbe_dbg_reg_ops_read().
On Fri, 2012-11-16 at 04:26 +0100, Cyril Roelandt wrote:
>
> copy_to_user() cannot return a negative value: it returns the number
> of bytes
> that could not be copied.
>
> Return -EFAULT on failure rather than the number of bytes that could
> not be
> copied, as this seems more standard.
>
> Signed-off-by: Cyril Roelandt <tipecaml@...il.com>
> ---
> drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
Actually, I already have a similar patch in my queue reported by Dan
Carpenter, and created by Josh Hay which fixes this issue. I should be
pushing the patch in my queue in the next week. Here is the patch I am
referring to:
ixgbe: eliminate Smatch warnings in ixgbe_debugfs.c
This patch replaces calls to copy_to_user, copy_from_user, and the
associated logic, with calls to simple_read_from_buffer and
simple_write_to_buffer respectively. This was done to eliminate
warnings generated by the Smatch static analysis tool.
Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
CC: Dan Carpenter <dan.carpenter@...cle.com>
Signed-off-by: Josh Hay <joshua.a.hay@...el.com>
Cheers,
Jeff
Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)
Powered by blists - more mailing lists