summaryrefslogtreecommitdiff
path: root/net/bridge/br_sysfs_if.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/bridge/br_sysfs_if.c')
-rw-r--r--net/bridge/br_sysfs_if.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/bridge/br_sysfs_if.c b/net/bridge/br_sysfs_if.c
index 8bd569695e76..abf711112418 100644
--- a/net/bridge/br_sysfs_if.c
+++ b/net/bridge/br_sysfs_if.c
@@ -230,6 +230,9 @@ static ssize_t brport_show(struct kobject *kobj,
struct brport_attribute *brport_attr = to_brport_attr(attr);
struct net_bridge_port *p = to_brport(kobj);
+ if (!brport_attr->show)
+ return -EINVAL;
+
return brport_attr->show(p, buf);
}