public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@osdl.org>
To: Greg KH <greg@kroah.com>
Cc: linus@osdl.org, akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] protect against buggy drivers
Date: Fri, 08 Oct 2004 11:27:25 -0700	[thread overview]
Message-ID: <1097260045.16787.59.camel@localhost.localdomain> (raw)
In-Reply-To: <20041008171414.GA28001@kroah.com>

Here is a better fix (thanks Greg) that allows long names for character
device objects.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>

diff -Nru a/fs/char_dev.c b/fs/char_dev.c
--- a/fs/char_dev.c	2004-10-08 11:14:29 -07:00
+++ b/fs/char_dev.c	2004-10-08 11:14:29 -07:00
@@ -207,8 +207,8 @@
 
 	cdev->owner = fops->owner;
 	cdev->ops = fops;
-	strcpy(cdev->kobj.name, name);
-	for (s = strchr(cdev->kobj.name, '/'); s; s = strchr(s, '/'))
+	kobject_set_name(&cdev->kobj, "%s", name);
+	for (s = strchr(kobject_name(&cdev->kobj),'/'); s; s = strchr(s, '/'))
 		*s = '!';
 		
 	err = cdev_add(cdev, MKDEV(cd->major, 0), 256);



  parent reply	other threads:[~2004-10-08 18:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-08 16:53 [PATCH] protect against buggy drivers Stephen Hemminger
2004-10-08 16:21 ` Alan Cox
2004-10-08 17:14 ` Greg KH
2004-10-08 17:29   ` Richard B. Johnson
2004-10-08 17:50     ` Greg KH
2004-10-08 18:31       ` Richard B. Johnson
2004-10-08 18:35         ` Greg KH
2004-10-08 19:32       ` Richard B. Johnson
2004-10-08 18:27   ` Stephen Hemminger [this message]
2004-10-08 18:36     ` Greg KH
2004-10-22 20:58     ` Greg KH

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=1097260045.16787.59.camel@localhost.localdomain \
    --to=shemminger@osdl.org \
    --cc=akpm@osdl.org \
    --cc=greg@kroah.com \
    --cc=linus@osdl.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox