Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3323115rwa; Tue, 23 Aug 2022 02:50:09 -0700 (PDT) X-Google-Smtp-Source: AA6agR7ASHvnQ2wZMuAOPdEvLSJxU5hAcoHtLoRtCMUlOgYY/IgvLpQpPY7iNbsoJkaqQs398Vmn X-Received: by 2002:a65:408b:0:b0:42a:55fb:60b0 with SMTP id t11-20020a65408b000000b0042a55fb60b0mr14783405pgp.431.1661248209392; Tue, 23 Aug 2022 02:50:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661248209; cv=none; d=google.com; s=arc-20160816; b=ZvSbuEDrgpjiOn7ymEj9SidMmwbilR3wjyRqqmYrbsLh3sVYlO6BqjsqA8M5Zl2bvA DubCHUU73R28Nra7hywUMny08+MabachOtrvYwBXjs5szgNKCpLG9hYDQZV7R8WqJVw8 Jyn7oLFk7ZM3iHFUNWO5M7RPBr/TnjusdvRx7Wx32CEwgcwCRPwKlHsv6WrGT5wC4aGe Pvq1YWVm2ecMJ/ylK3FgVvQO7AHmWLX5w1fMmYQsUoK4V0SXF7ZQPY1K3TsThpb3kLQY T/q+g9Ir6kLwsHNOWwYZhPn3Itxz0MVsgm51C8V3b4sKQQXxI/3qvfOZ8o5X4iosBkR3 LU4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=USsefbhg9vh22mEZvgITJInWq/z6FAXNMz9vEzIqkWQ=; b=wgMGYOlPquiROKej5OsXT+kEnXEeTgyrk4tdG7Kyv77qM9ngOlZxVruLglPc8JVhqs E2YD/f1pTAwx3xDzjAbdQu5n+hI/B9jBCKITVeyFAdm+vpJFM6qswOBJUkUsh0VlB0Vs aAWHeCBVfi9Kv7Z2FcXTKOXyL5FeJVHvhjzZYe8vOpLFk49GzfWtn6Oj97MIPR4yzPyZ MFJEVXWws6VlUbAHVhuw4y3DIDAClw1fNtCfzrFqFAbMF/J+2YOUoIM4RBKHXBnKb0HP rRTnMn3HrpLDpb9mjMXRrT0Kv5QXSEU4YeiwudRQS76QHClDJR+TVoX78KOaxPEcclMO NO7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GewB7pae; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y3-20020a170902864300b00170aa42dc07si14159057plt.191.2022.08.23.02.49.58; Tue, 23 Aug 2022 02:50:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GewB7pae; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348981AbiHWJO0 (ORCPT + 99 others); Tue, 23 Aug 2022 05:14:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349332AbiHWJLa (ORCPT ); Tue, 23 Aug 2022 05:11:30 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0835386C37; Tue, 23 Aug 2022 01:31:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 09485CE1B34; Tue, 23 Aug 2022 08:31:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 06D13C433C1; Tue, 23 Aug 2022 08:31:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661243472; bh=skXDE7HoEs1CM7r5+jZrhjl8BpmwHHmVvjU7vqHj44E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GewB7pae6xuQCN6bM2E6RBHQfMhyuvQjVaRlbFJyaAc9ZOvV9GU8vxkfLsGdgS6QR O1/NKMXPda+7o6aa/sCofl5b0U3cyPp5J3L83DoUYxF3WsRD2ti71oTe5ZJSIOtpWt N5W2qydmL8P8eiJM00IPSo/bfFWTpXAU05rei7i8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dafna Hirschfeld , Oded Gabbay , Sasha Levin Subject: [PATCH 5.19 288/365] habanalabs: add terminating NULL to attrs arrays Date: Tue, 23 Aug 2022 10:03:09 +0200 Message-Id: <20220823080130.259653833@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080118.128342613@linuxfoundation.org> References: <20220823080118.128342613@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dafna Hirschfeld [ Upstream commit 78d503087be190eab36290644ccec050135e7c70 ] 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 Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Sasha Levin --- drivers/misc/habanalabs/common/sysfs.c | 2 ++ drivers/misc/habanalabs/gaudi/gaudi.c | 1 + drivers/misc/habanalabs/goya/goya_hwmgr.c | 2 ++ 3 files changed, 5 insertions(+) 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, diff --git a/drivers/misc/habanalabs/gaudi/gaudi.c b/drivers/misc/habanalabs/gaudi/gaudi.c index fba322241096..25d735aee6a3 100644 --- a/drivers/misc/habanalabs/gaudi/gaudi.c +++ b/drivers/misc/habanalabs/gaudi/gaudi.c @@ -9187,6 +9187,7 @@ static DEVICE_ATTR_RO(infineon_ver); static struct attribute *gaudi_vrm_dev_attrs[] = { &dev_attr_infineon_ver.attr, + NULL, }; static void gaudi_add_device_attr(struct hl_device *hdev, struct attribute_group *dev_clk_attr_grp, diff --git a/drivers/misc/habanalabs/goya/goya_hwmgr.c b/drivers/misc/habanalabs/goya/goya_hwmgr.c index 6580fc6a486a..b595721751c1 100644 --- a/drivers/misc/habanalabs/goya/goya_hwmgr.c +++ b/drivers/misc/habanalabs/goya/goya_hwmgr.c @@ -359,6 +359,7 @@ static struct attribute *goya_clk_dev_attrs[] = { &dev_attr_pm_mng_profile.attr, &dev_attr_tpc_clk.attr, &dev_attr_tpc_clk_curr.attr, + NULL, }; static ssize_t infineon_ver_show(struct device *dev, struct device_attribute *attr, char *buf) @@ -375,6 +376,7 @@ static DEVICE_ATTR_RO(infineon_ver); static struct attribute *goya_vrm_dev_attrs[] = { &dev_attr_infineon_ver.attr, + NULL, }; void goya_add_device_attr(struct hl_device *hdev, struct attribute_group *dev_clk_attr_grp, -- 2.35.1