dgnc_ports_state_show is removed, since it exposes ports status which help an 
adversary to
plan an attack.

Signed-off-by: Salah Triki <salah.tr...@acm.org>
---
 drivers/staging/dgnc/dgnc_sysfs.c | 21 ---------------------
 1 file changed, 21 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_sysfs.c 
b/drivers/staging/dgnc/dgnc_sysfs.c
index 48b6056..00c02df 100644
--- a/drivers/staging/dgnc/dgnc_sysfs.c
+++ b/drivers/staging/dgnc/dgnc_sysfs.c
@@ -153,25 +153,6 @@ static ssize_t dgnc_serial_number_show(struct device *p,
 static DEVICE_ATTR(serial_number, S_IRUSR, dgnc_serial_number_show, NULL);
 
 
-static ssize_t dgnc_ports_state_show(struct device *p,
-                                    struct device_attribute *attr, char *buf)
-{
-       struct dgnc_board *bd;
-       int count = 0;
-       int i = 0;
-
-       DGNC_VERIFY_BOARD(p, bd);
-
-       for (i = 0; i < bd->nasync; i++) {
-               count += snprintf(buf + count, PAGE_SIZE - count,
-                       "%d %s\n", bd->channels[i]->ch_portnum,
-                       bd->channels[i]->ch_open_count ? "Open" : "Closed");
-       }
-       return count;
-}
-static DEVICE_ATTR(ports_state, S_IRUSR, dgnc_ports_state_show, NULL);
-
-
 static ssize_t dgnc_ports_baud_show(struct device *p,
                                    struct device_attribute *attr, char *buf)
 {
@@ -364,7 +345,6 @@ void dgnc_create_ports_sysfiles(struct dgnc_board *bd)
        int rc = 0;
 
        dev_set_drvdata(&bd->pdev->dev, bd);
-       rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_state);
        rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_baud);
        rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_msignals);
        rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_iflag);
@@ -384,7 +364,6 @@ void dgnc_create_ports_sysfiles(struct dgnc_board *bd)
 /* removes all the sys files created for that port */
 void dgnc_remove_ports_sysfiles(struct dgnc_board *bd)
 {
-       device_remove_file(&(bd->pdev->dev), &dev_attr_ports_state);
        device_remove_file(&(bd->pdev->dev), &dev_attr_ports_baud);
        device_remove_file(&(bd->pdev->dev), &dev_attr_ports_msignals);
        device_remove_file(&(bd->pdev->dev), &dev_attr_ports_iflag);
-- 
1.9.1

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to