Browse Source

RDMA/hfi1: fix array termination by appending NULL to attr array

This fixes a kernel panic when loading the hfi driver as a dynamic module.

Signed-off-by: Steven L Roberts <robers97@gmail.com>
Reviewed-by: Leon Romanovsky <leon@kernel.org>
Acked-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Steven L. Roberts 8 years ago
parent
commit
c4dd4b69f5
1 changed files with 2 additions and 1 deletions
  1. 2 1
      drivers/infiniband/hw/hfi1/sysfs.c

+ 2 - 1
drivers/infiniband/hw/hfi1/sysfs.c

@@ -196,7 +196,8 @@ static const struct sysfs_ops port_cc_sysfs_ops = {
 };
 };
 
 
 static struct attribute *port_cc_default_attributes[] = {
 static struct attribute *port_cc_default_attributes[] = {
-	&cc_prescan_attr.attr
+	&cc_prescan_attr.attr,
+	NULL
 };
 };
 
 
 static struct kobj_type port_cc_ktype = {
 static struct kobj_type port_cc_ktype = {