summaryrefslogtreecommitdiff
path: root/drivers/misc/habanalabs/common/sysfs.c
diff options
context:
space:
mode:
authorDafna Hirschfeld <dhirschfeld@habana.ai>2022-05-19 10:54:30 +0300
committerOded Gabbay <ogabbay@kernel.org>2022-07-12 09:09:21 +0300
commit78d503087be190eab36290644ccec050135e7c70 (patch)
treefb2bd683e28803723dee559e7c0386f9cd254338 /drivers/misc/habanalabs/common/sysfs.c
parent18b67315388cb528479050839c69d245164f6183 (diff)
downloadlinux-78d503087be190eab36290644ccec050135e7c70.tar.xz
habanalabs: add terminating NULL to attrs arrays
Arrays of struct attribute are expected to be NULL terminated. This is required by API methods such as device_add_groups. This fixes a crash when loading the driver for Goya device. Signed-off-by: Dafna Hirschfeld <dhirschfeld@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Diffstat (limited to 'drivers/misc/habanalabs/common/sysfs.c')
-rw-r--r--drivers/misc/habanalabs/common/sysfs.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/misc/habanalabs/common/sysfs.c b/drivers/misc/habanalabs/common/sysfs.c
index 9ebeb18ab85e..da8181068895 100644
--- a/drivers/misc/habanalabs/common/sysfs.c
+++ b/drivers/misc/habanalabs/common/sysfs.c
@@ -73,6 +73,7 @@ static DEVICE_ATTR_RO(clk_cur_freq_mhz);
static struct attribute *hl_dev_clk_attrs[] = {
&dev_attr_clk_max_freq_mhz.attr,
&dev_attr_clk_cur_freq_mhz.attr,
+ NULL,
};
static ssize_t vrm_ver_show(struct device *dev, struct device_attribute *attr, char *buf)
@@ -93,6 +94,7 @@ static DEVICE_ATTR_RO(vrm_ver);
static struct attribute *hl_dev_vrm_attrs[] = {
&dev_attr_vrm_ver.attr,
+ NULL,
};
static ssize_t uboot_ver_show(struct device *dev, struct device_attribute *attr,