From: Oleg Drokin <green@namesys.com>
To: Jeff Dike <jdike@karaya.com>
Cc: user-mode-linux-devel@lists.sourceforge.net,
linux-kernel@vger.kernel.org
Subject: UML and 2.5.43
Date: Wed, 16 Oct 2002 12:50:37 +0400 [thread overview]
Message-ID: <20021016125037.A6413@namesys.com> (raw)
In-Reply-To: <200210151717.MAA02888@ccure.karaya.com>
Hello!
I noticed that in 2.5.43 ubd does not work anymore until
you enable devfs support, since devfs_register is now only
return meaningful values if devfs is compiled, otherwise it
just returns NULL, and ubd treats this as error. Since UML
itself only uses that value for subsequent freeing of devfs node,
it is quite safe (returned NULL means nothing should be freed
later ;) )
Probably attached patch is one of the right things to do.
As additional bonus it fixes uninitialised variable usage ;)
Bye,
Oleg
# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
# ChangeSet 1.859 -> 1.860
# arch/um/drivers/ubd_kern.c 1.10 -> 1.11
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/10/16 green@angband.namesys.com 1.860
# do not look at return values from devfs_register stuff
# --------------------------------------------
#
diff -Nru a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
--- a/arch/um/drivers/ubd_kern.c Wed Oct 16 12:41:24 2002
+++ b/arch/um/drivers/ubd_kern.c Wed Oct 16 12:41:24 2002
@@ -469,9 +469,7 @@
MAJOR_NR, n << UBD_SHIFT,
S_IFBLK | S_IRUSR | S_IWUSR | S_IRGRP |S_IWGRP,
&ubd_blops, NULL);
- if(real == NULL)
- goto out;
- ubd_dev[n].real = real;
+ ubd_dev[n].real = real;
if (fake_major) {
fake = devfs_register(ubd_fake_dir_handle, name,
@@ -479,20 +477,16 @@
n << UBD_SHIFT,
S_IFBLK | S_IRUSR | S_IWUSR | S_IRGRP |
S_IWGRP, &ubd_blops, NULL);
- if(fake == NULL)
- goto out_unregister;
- ubd_dev[n].fake = fake;
+ ubd_dev[n].fake = fake;
add_disk(fake_disk);
+
}
add_disk(disk);
make_ide_entries(disk->disk_name);
return(0);
- out_unregister:
- devfs_unregister(real);
- ubd_dev[n].real = NULL;
out:
return(-1);
}
@@ -700,6 +694,6 @@
{
int n = DEVICE_NR(inode->i_rdev);
struct ubd *dev = &ubd_dev[n];
- int err;
+ int err = -EISDIR;
if(dev->is_dir == 1)
goto out;
next prev parent reply other threads:[~2002-10-16 8:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-15 17:17 uml-patch-2.5.42-2 Jeff Dike
2002-10-16 8:50 ` Oleg Drokin [this message]
2002-10-16 11:27 ` [uml-devel] UML and 2.5.43 Jeff Dike
2002-10-16 16:16 ` Mike Anderson
2002-10-17 1:36 ` Jeff Dike
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=20021016125037.A6413@namesys.com \
--to=green@namesys.com \
--cc=jdike@karaya.com \
--cc=linux-kernel@vger.kernel.org \
--cc=user-mode-linux-devel@lists.sourceforge.net \
/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®