[PATCH 4.9 183/310] RDMA/hfi1: fix array termination by appending NULL to attr array

From: Greg Kroah-Hartman
Date: Wed Apr 11 2018 - 15:01:09 EST


4.9-stable review patch. If anyone has any objections, please let me know.

------------------

From: "Steven L. Roberts" <robers97@xxxxxxxxx>


[ Upstream commit c4dd4b69f55abcc8dd079f8de55d9d8c2ddbefce ]

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

Signed-off-by: Steven L Roberts <robers97@xxxxxxxxx>
Reviewed-by: Leon Romanovsky <leon@xxxxxxxxxx>
Acked-by: Dennis Dalessandro <dennis.dalessandro@xxxxxxxxx>
Signed-off-by: Doug Ledford <dledford@xxxxxxxxxx>
Signed-off-by: Sasha Levin <alexander.levin@xxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
drivers/infiniband/hw/hfi1/sysfs.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/infiniband/hw/hfi1/sysfs.c
+++ b/drivers/infiniband/hw/hfi1/sysfs.c
@@ -196,7 +196,8 @@ static const struct sysfs_ops port_cc_sy
};

static struct attribute *port_cc_default_attributes[] = {
- &cc_prescan_attr.attr
+ &cc_prescan_attr.attr,
+ NULL
};

static struct kobj_type port_cc_ktype = {