diff options
author | Jan Glauber <jang@linux.vnet.ibm.com> | 2009-01-09 14:14:55 +0300 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2009-01-09 14:15:07 +0300 |
commit | 19cdd08ba155dd87ebb87bb39ed097dbee671e0e (patch) | |
tree | 480c3dd45ecda6b692637168b4aea7ddde6bfaae /drivers | |
parent | 81ffa0415b7ac9215c2030e2b15b8efff46605a0 (diff) | |
download | linux-19cdd08ba155dd87ebb87bb39ed097dbee671e0e.tar.xz |
[S390] qdio: fix broken pointer in case of CONFIG_DEBUG_FS is disabled
If CONFIG_DEBUG_FS is disabled debugfs_create_file returns -ENODEV instead
of zero. Since the return value is stored and used at shutdown to remove
existing entries an OOPS may be triggered.
Add a check of the debugfs_create_file return value and in case of an error
set the entry to NULL so it will be ignored at shutdown.
Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/s390/cio/qdio_debug.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/s390/cio/qdio_debug.c b/drivers/s390/cio/qdio_debug.c index f8a3b6967f69..da7afb04e71f 100644 --- a/drivers/s390/cio/qdio_debug.c +++ b/drivers/s390/cio/qdio_debug.c @@ -169,6 +169,8 @@ static void setup_debugfs_entry(struct qdio_q *q, struct ccw_device *cdev) q->nr); debugfs_queues[i] = debugfs_create_file(name, S_IFREG | S_IRUGO | S_IWUSR, debugfs_root, q, &debugfs_fops); + if (IS_ERR(debugfs_queues[i])) + debugfs_queues[i] = NULL; } void qdio_setup_debug_entries(struct qdio_irq *irq_ptr, struct ccw_device *cdev) |