Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751492Ab2KPEmi (ORCPT ); Thu, 15 Nov 2012 23:42:38 -0500 Received: from mga11.intel.com ([192.55.52.93]:7632 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751290Ab2KPEmh (ORCPT ); Thu, 15 Nov 2012 23:42:37 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.83,261,1352102400"; d="asc'?scan'208";a="247815488" Message-ID: <1353040955.2337.82.camel@jtkirshe-mobl> Subject: Re: [PATCH] net/ethernet/intel/ixgbe/ixgbe_debugfs.c: fix error handling in ixgbe_dbg_reg_ops_read(). From: Jeff Kirsher Reply-To: jeffrey.t.kirsher@intel.com To: Cyril Roelandt Cc: e1000-devel@lists.sourceforge.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "Hay, Joshua A" , Dan Carpenter Date: Thu, 15 Nov 2012 20:42:35 -0800 In-Reply-To: <1353036410-14439-1-git-send-email-tipecaml@gmail.com> References: <1353036410-14439-1-git-send-email-tipecaml@gmail.com> Organization: Intel Corporation Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-+dlIMMFFvIBgsejx9Xtl" X-Mailer: Evolution 3.4.4 (3.4.4-2.fc17) Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2589 Lines: 69 --=-+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-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/