From: Patrick Mullaney <pmullaney@novell.com>
To: alacrityvm-devel@lists.sourceforge.net
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: [PATCH 1/2] venet-macvlan: correctly remove newline from lower device name
Date: Wed, 02 Dec 2009 16:10:26 -0500 [thread overview]
Message-ID: <20091202211026.5116.67536.stgit@mimic.site> (raw)
In-Reply-To: <20091202204722.5116.33183.stgit@mimic.site>
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);
next prev parent reply other threads:[~2009-12-02 21:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-02 21:10 [PATCH 0/2] registration fixes for vbus venet macvlan driver Patrick Mullaney
2009-12-02 21:10 ` Patrick Mullaney [this message]
2009-12-02 21:10 ` [PATCH 2/2] venet: Fixes for shutdown and re-registration of venet devices Patrick Mullaney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091202211026.5116.67536.stgit@mimic.site \
--to=pmullaney@novell.com \
--cc=alacrityvm-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®