All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Driver Core fixes for 2.6.6-rc2
Date: Thu, 22 Apr 2004 15:30:48 -0700	[thread overview]
Message-ID: <10826730482148@kroah.com> (raw)
In-Reply-To: <10826730481875@kroah.com>

ChangeSet 1.1929, 2004/04/22 15:11:12-07:00, lxiep@us.ibm.com

[PATCH] symlink doesn't support kobj name > 20 charaters (KOBJ_NAME_LEN)

Since symlink.c uses "name" field of a kobj when it calculates the
length,  it gets a wrong value if the kobj's name  has more than 20
charathers.  A correct way to do that is to call kobject_name(kobj)
instead of using kobj->name directly.


 fs/sysfs/symlink.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)


diff -Nru a/fs/sysfs/symlink.c b/fs/sysfs/symlink.c
--- a/fs/sysfs/symlink.c	Thu Apr 22 15:27:07 2004
+++ b/fs/sysfs/symlink.c	Thu Apr 22 15:27:07 2004
@@ -42,7 +42,7 @@
 	struct kobject * p = kobj;
 	int length = 1;
 	do {
-		length += strlen(p->name) + 1;
+		length += strlen(kobject_name(p)) + 1;
 		p = p->parent;
 	} while (p);
 	return length;
@@ -54,11 +54,11 @@
 
 	--length;
 	for (p = kobj; p; p = p->parent) {
-		int cur = strlen(p->name);
+		int cur = strlen(kobject_name(p));
 
 		/* back up enough to print this bus id with '/' */
 		length -= cur;
-		strncpy(buffer + length,p->name,cur);
+		strncpy(buffer + length,kobject_name(p),cur);
 		*(buffer + --length) = '/';
 	}
 }


      reply	other threads:[~2004-04-22 22:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-22 22:28 [BK PATCH] Driver Core fixes for 2.6.6-rc2 Greg KH
2004-04-22 22:30 ` [PATCH] " Greg KH
2004-04-22 22:30   ` Greg KH
2004-04-22 22:30     ` Greg KH [this message]

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=10826730482148@kroah.com \
    --to=greg@kroah.com \
    --cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.