Re: 2.6.25-git16 -- BUG: unable to handle kernel NULL pointerdereference at 00000000 -- IP: [<c02dd5d5>] fw_show_drv_device_ids+0xd9/0xee

From: Stefan Richter
Date: Thu May 01 2008 - 04:44:28 EST


On 30 Apr, Miles Lane wrote:
> BUG: unable to handle kernel NULL pointer dereference at 00000000
> IP: [<c02dd5d5>] fw_show_drv_device_ids+0xd9/0xee
[...]

Is everything alright again with this patch?

From: Stefan Richter <stefanr@xxxxxxxxxxxxxxxxx>
Subject: ieee1394: fix NULL pointer dereference in sysfs access

Regression since "ieee1394: prevent device binding of raw1394,
video1394, dv1394", commit d2ace29fa44589da51fedc06a67b3f05301f3bfd:
$ cat /sys/bus/ieee1394/drivers/raw1394/device_ids
triggers a NULL pointer dereference in fw_show_drv_device_ids.

Reported-by: Miles Lane <miles.lane@xxxxxxxxx>
Signed-off-by: Stefan Richter <stefanr@xxxxxxxxxxxxxxxxx>
---
drivers/ieee1394/nodemgr.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

Index: linux/drivers/ieee1394/nodemgr.c
===================================================================
--- linux.orig/drivers/ieee1394/nodemgr.c
+++ linux/drivers/ieee1394/nodemgr.c
@@ -520,8 +520,11 @@ static ssize_t fw_show_drv_device_ids(st
char *scratch = buf;

driver = container_of(drv, struct hpsb_protocol_driver, driver);
+ id = driver->id_table;
+ if (!id)
+ return 0;

- for (id = driver->id_table; id->match_flags != 0; id++) {
+ for (; id->match_flags != 0; id++) {
int need_coma = 0;

if (id->match_flags & IEEE1394_MATCH_VENDOR_ID) {

--
Stefan Richter
-=====-==--- -=-= ----=
http://arcgraph.de/sr/

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/