hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/infiniband/hw/hfi1/firmware.c
....@@ -1786,6 +1786,7 @@
17861786
17871787 if (!dd->platform_config.data) {
17881788 dd_dev_err(dd, "%s: Missing config file\n", __func__);
1789
+ ret = -EINVAL;
17891790 goto bail;
17901791 }
17911792 ptr = (u32 *)dd->platform_config.data;
....@@ -1794,6 +1795,7 @@
17941795 ptr++;
17951796 if (magic_num != PLATFORM_CONFIG_MAGIC_NUM) {
17961797 dd_dev_err(dd, "%s: Bad config file\n", __func__);
1798
+ ret = -EINVAL;
17971799 goto bail;
17981800 }
17991801
....@@ -1817,6 +1819,7 @@
18171819 if (file_length > dd->platform_config.size) {
18181820 dd_dev_info(dd, "%s:File claims to be larger than read size\n",
18191821 __func__);
1822
+ ret = -EINVAL;
18201823 goto bail;
18211824 } else if (file_length < dd->platform_config.size) {
18221825 dd_dev_info(dd,
....@@ -1837,6 +1840,7 @@
18371840 dd_dev_err(dd, "%s: Failed validation at offset %ld\n",
18381841 __func__, (ptr - (u32 *)
18391842 dd->platform_config.data));
1843
+ ret = -EINVAL;
18401844 goto bail;
18411845 }
18421846
....@@ -1880,6 +1884,7 @@
18801884 __func__, table_type,
18811885 (ptr - (u32 *)
18821886 dd->platform_config.data));
1887
+ ret = -EINVAL;
18831888 goto bail; /* We don't trust this file now */
18841889 }
18851890 pcfgcache->config_tables[table_type].table = ptr;
....@@ -1899,6 +1904,7 @@
18991904 __func__, table_type,
19001905 (ptr -
19011906 (u32 *)dd->platform_config.data));
1907
+ ret = -EINVAL;
19021908 goto bail; /* We don't trust this file now */
19031909 }
19041910 pcfgcache->config_tables[table_type].table_metadata =