From 69fb09d011fd3ca746783891a19f10d900978ae1 Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Mon, 21 Jan 2013 21:28:13 -0600 Subject: [PATCH] dahdi: Initialize the channels cdev structure. This is necessary to prevent a crash when opening files by the new device files, which do not have a valid file_operations structure. This fixes a problem does not exist in any releases of DAHDI. Since none of the existing tools or applications open files from the new location of /dev/dahdi/channels//, this wasn't seen until just recently. Reported-by: Ted Gerold Signed-off-by: Shaun Ruffell --- drivers/dahdi/dahdi-sysfs-chan.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/dahdi/dahdi-sysfs-chan.c b/drivers/dahdi/dahdi-sysfs-chan.c index 84bfef9..f6fe7de 100644 --- a/drivers/dahdi/dahdi-sysfs-chan.c +++ b/drivers/dahdi/dahdi-sysfs-chan.c @@ -463,6 +463,7 @@ int __init dahdi_sysfs_chan_init(const struct file_operations *fops) goto cleanup; } dahdi_dbg(DEVICES, "adding channels cdev\n"); + cdev_init(&dahdi_channels_cdev, fops); res = cdev_add(&dahdi_channels_cdev, dahdi_channels_devt, DAHDI_MAX_CHANNELS); if (res) {