From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Kirsher Subject: Re: [PATCH] net/ethernet/intel/ixgbe/ixgbe_debugfs.c: fix error handling in ixgbe_dbg_reg_ops_read(). Date: Thu, 15 Nov 2012 20:42:35 -0800 Message-ID: <1353040955.2337.82.camel@jtkirshe-mobl> References: <1353036410-14439-1-git-send-email-tipecaml@gmail.com> Reply-To: jeffrey.t.kirsher@intel.com Mime-Version: 1.0 Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-+dlIMMFFvIBgsejx9Xtl" Cc: e1000-devel@lists.sourceforge.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "Hay, Joshua A" , Dan Carpenter To: Cyril Roelandt Return-path: In-Reply-To: <1353036410-14439-1-git-send-email-tipecaml@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org --=-+dlIMMFFvIBgsejx9Xtl Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 2012-11-16 at 04:26 +0100, Cyril Roelandt wrote: >=20 > copy_to_user() cannot return a negative value: it returns the number > of bytes > that could not be copied. >=20 > Return -EFAULT on failure rather than the number of bytes that could > not be > copied, as this seems more standard. >=20 > Signed-off-by: Cyril Roelandt > --- > drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-)=20 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 =20 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. =20 Reported-by: Dan Carpenter CC: Dan Carpenter Signed-off-by: Josh Hay Cheers, Jeff --=-+dlIMMFFvIBgsejx9Xtl Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAABCgAGBQJQpcQ7AAoJEOVv75VaS+3OtLsP/ipADMM/r68xkkLvh0zJxT7/ Q51gIWkA5B5hlzJnu/WZ5Rjy/d4ai/JrMy+9pRqgnmUwGifEtvM/gNwzyfsyIKqm CjIuxXixXnBzkH8s7Sh06zTKKVUr4TXvLoXboVqqkIMEE6GxImK1XhfrvM6vQziv QYzilj/lR6lluSXnOHpyLZiGpGI2d7M45aP8YSNMHd5EPxT0YXXOIR9UBFP26nP5 Osa62LMrRlM6eIbL7XwoxJOS5dnjOYhZUL3wFbK+GzwaGqieJJcmmFW9LL9ZFhfV pA/sI6Tv72devBpNx5tG62StV+Jtlpnb63IpZnWL5PR5Dj9/yn74fBfAgPBAsfg9 Q2ftBbdjpIqN0NGbYkD3NkrJPM0L8f4Hx42Q32+tEY4QimkHZ2ip8WtIS+7Oak+8 3EaWlhwleouJmHQPC45p3yC9jtjo7WA3g+ZE3Beu0uNmCm3p0UbO3WAykFrrs4hA QhCzCFLIiaMT5UrW/+01ij4c473bjYGwi3fYOdjB0OMhVB49x5R10D6fEWxKXbzH Wz2yPM5lT4+TSxC3a8rOhcigAzw6F+fiupepaaGgci/yd4ZUUnqKRuPSud4ztB5Z vSKOoYhVMw2QA2OKNPH62pkykbFpP8SQxxE8CSqiGqbHCiPyUyBIFVWGjwiDAPR2 tHkLYqzzQh8UpVaCsL24 =fTu5 -----END PGP SIGNATURE----- --=-+dlIMMFFvIBgsejx9Xtl--