]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Rework the previous fix for the IB vs Ethernet sysctl handler to be more
authorjhb <jhb@FreeBSD.org>
Thu, 18 Jul 2013 14:06:01 +0000 (14:06 +0000)
committerjhb <jhb@FreeBSD.org>
Thu, 18 Jul 2013 14:06:01 +0000 (14:06 +0000)
commit45bc92633de9aa07c98b009b403dd3f2ee1cdcb4
tree53517fe73ddfbbe7695904e0147a7dc98f5c2a7e
parent7315f75ab2c4c78e890de3bff455a50d13361ba8
Rework the previous fix for the IB vs Ethernet sysctl handler to be more
generic and apply to all sysfs attributes:
- Use sysctl_handle_string() instead of reimplementing it.
- Remove trailing newline from the current value before passing it to
  userland and append a newline to the new string value before passing it
  to the attribute's store function.
- Don't leak the temporary buffer if the first error check triggers.
- Revert earlier change to mlx4 port mode handler.

PR: kern/174213
Submitted by: Garrett Cooper
Reviewed by: Shakar Klein @ Mellanox
MFC after: 1 week
sys/ofed/drivers/net/mlx4/main.c
sys/ofed/include/linux/sysfs.h