aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ieee1394/nodemgr.c
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2008-05-01 04:43:04 -0400
committerStefan Richter <stefanr@s5r6.in-berlin.de>2008-05-01 13:55:23 -0400
commit07c7224cf74c3977c69c7c9a0b0fba264f2df36a (patch)
tree5631421f793e43e990820f33bdf6eb981f586792 /drivers/ieee1394/nodemgr.c
parente38649702ea64fdbbab3dd459bf8558142dd3bc4 (diff)
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. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Tested-by: Miles Lane <miles.lane@gmail.com>
Diffstat (limited to 'drivers/ieee1394/nodemgr.c')
-rw-r--r--drivers/ieee1394/nodemgr.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c
index 70afa3786f3..c6babe802a3 100644
--- a/drivers/ieee1394/nodemgr.c
+++ b/drivers/ieee1394/nodemgr.c
@@ -520,8 +520,11 @@ static ssize_t fw_show_drv_device_ids(struct device_driver *drv, char *buf)
520 char *scratch = buf; 520 char *scratch = buf;
521 521
522 driver = container_of(drv, struct hpsb_protocol_driver, driver); 522 driver = container_of(drv, struct hpsb_protocol_driver, driver);
523 id = driver->id_table;
524 if (!id)
525 return 0;
523 526
524 for (id = driver->id_table; id->match_flags != 0; id++) { 527 for (; id->match_flags != 0; id++) {
525 int need_coma = 0; 528 int need_coma = 0;
526 529
527 if (id->match_flags & IEEE1394_MATCH_VENDOR_ID) { 530 if (id->match_flags & IEEE1394_MATCH_VENDOR_ID) {