All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Reppert <repp0017@tc.umn.edu>
To: Guennadi Liakhovetski <gl@dsa-ac.de>
Cc: linux-kernel@vger.kernel.org,
	Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
	Patrick Mochel <mochel@osdl.org>
Subject: Re: [OOPS] 2.6.0-test11 sysfs
Date: Tue, 09 Dec 2003 11:57:28 -0600	[thread overview]
Message-ID: <1070992648.27231.7.camel@minerva> (raw)
In-Reply-To: <Pine.LNX.4.33.0312091826090.1130-100000@pcgl.dsa-ac.de>

On Tue, 2003-12-09 at 11:35, Guennadi Liakhovetski wrote:
> Hello
> 
> Just installed 2.6.0-test11 on a Toshiba notebook, and  booting / loading
> PCMCIA produces the following Oops:
> 
> Linux Kernel Card Services
>   options:  [pci] [pm]
> Intel PCIC probe:
>   Intel i82365sl B step ISA-to-PCMCIA at port 0x3e0 ofs 0x00, 2 sockets
>     host opts [0]: none
>     host opts [1]: none
>     ISA irqs (scanned) = 3,4,5,7,9,10<6>    PCI card interrupts, status change on irq 10
> Unable to handle kernel NULL pointer dereference at virtual address 0000000c
>  printing eip:
> c01785a4
> *pde = 00000000
> Oops: 0000 [#1]
> CPU:    0
> EIP:    0060:[<c01785a4>]    Not tainted
> EFLAGS: 00010282
> EIP is at sysfs_add_file+0xc/0x80
> eax: 00000000   ebx: c40370ec   ecx: 00000001   edx: 00000000
> esi: 00000001   edi: c4037e94   ebp: c1f7ff64   esp: c1f7ff58
> ds: 007b   es: 007b   ss: 0068
> Process modprobe (pid: 212, threadinfo=c1f7e000 task=c1f5cd20)
> Stack: c40370ec 00000001 c4036f44 c1f7ff74 c0178633 00000000 c4037e94 c1f7ff84
>        c01e3524 c40370f4 c4037e94 c1f7ffa4 c403b0b0 c40370ec c4037e94 c1f7e000
>        c4038020 c02b3040 00000224 c1f7ffbc c01323ab 40134000 0804bb2f bffffbbc
> Call Trace:
>  [<c0178633>] sysfs_create_file+0x1b/0x28
>  [<c01e3524>] class_device_create_file+0x1c/0x20
>  [<c403b0b0>] init_i82365+0x12c/0x1bc [i82365]
>  [<c01323ab>] sys_init_module+0xfb/0x200
>  [<c010a037>] syscall_call+0x7/0xb
> 
> Code: 8b 42 0c 8d 48 6c ff 48 6c 0f 88 3e 01 00 00 8b 07 50 52 e8
>  <6>cs: IO port probe 0x0c00-0x0cff: clean.
> cs: IO port probe 0x0800-0x08ff: clean.
> cs: IO port probe 0x0100-0x04ff: excluding 0x220-0x22f 0x330-0x337 0x378-0x37f 0x388-0x38f 0x3c0-0x3e7 0x480-0x48f 0x4d0-0x4d7
> cs: IO port probe 0x0a00-0x0aff: clean.
> 
> Right, you guessed it - there was no /sys directory:-) Shouldn't lead to
> an Oops though... Is it known already?

Hi,

Try this patch. (Patrick, is this the sane thing to do? And is it worth
it? If so, I can do similar things to the other sysfs_create_* functions
if you would like.)

Matt



  Avoid an oops if we try to add a file when sysfs mount point doesn't
exist.



diff -puN fs/sysfs/file.c~sysfs-add-file-oops fs/sysfs/file.c
--- linux-2.6.0-test11/fs/sysfs/file.c~sysfs-add-file-oops	2003-12-09
11:46:58.025205656 -0600
+++ linux-2.6.0-test11-arashi/fs/sysfs/file.c	2003-12-09
11:47:28.781529984 -0600
@@ -374,7 +374,7 @@ int sysfs_add_file(struct dentry * dir, 
 
 int sysfs_create_file(struct kobject * kobj, const struct attribute *
attr)
 {
-	if (kobj && attr)
+	if (kobj && kobj->dentry && attr)
 		return sysfs_add_file(kobj->dentry,attr);
 	return -EINVAL;
 }

_


  reply	other threads:[~2003-12-09 17:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-09 17:35 [OOPS] 2.6.0-test11 sysfs Guennadi Liakhovetski
2003-12-09 17:57 ` Matthew Reppert [this message]
2003-12-09 18:17   ` Guennadi Liakhovetski
2003-12-09 21:14   ` Russell King
2003-12-10  9:30     ` Guennadi Liakhovetski
2003-12-10 11:06     ` Maneesh Soni
2003-12-10 11:14       ` Russell King

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=1070992648.27231.7.camel@minerva \
    --to=repp0017@tc.umn.edu \
    --cc=g.liakhovetski@gmx.de \
    --cc=gl@dsa-ac.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mochel@osdl.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.