lkml.org 
[lkml]   [2009]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/2] venet-macvlan: correctly remove newline from lower device name
Date
Signed-off-by: Patrick Mullaney <pmullaney@novell.com>
---

kernel/vbus/devices/venet/macvlan.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/kernel/vbus/devices/venet/macvlan.c b/kernel/vbus/devices/venet/macvlan.c
index 8724e26..432ff5d 100644
--- a/kernel/vbus/devices/venet/macvlan.c
+++ b/kernel/vbus/devices/venet/macvlan.c
@@ -350,7 +350,11 @@ ll_ifname_store(struct vbus_device *dev, struct vbus_device_attribute *attr,
if (priv->dev.vbus.opened)
return -EINVAL;

- strncpy(priv->ll_ifname, buf, count-1);
+ memcpy(priv->ll_ifname, buf, count);
+
+ /* remove trailing newline if present */
+ if (priv->ll_ifname[count-1] == '\n')
+ priv->ll_ifname[count-1] = '\0';

if (priv->mdev.lowerdev) {
dev_put(priv->mdev.lowerdev);


\
 
 \ /
  Last update: 2009-12-02 22:13    [W:0.042 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site