| .. | .. |
|---|
| 1786 | 1786 | |
|---|
| 1787 | 1787 | if (!dd->platform_config.data) { |
|---|
| 1788 | 1788 | dd_dev_err(dd, "%s: Missing config file\n", __func__); |
|---|
| 1789 | + ret = -EINVAL; |
|---|
| 1789 | 1790 | goto bail; |
|---|
| 1790 | 1791 | } |
|---|
| 1791 | 1792 | ptr = (u32 *)dd->platform_config.data; |
|---|
| .. | .. |
|---|
| 1794 | 1795 | ptr++; |
|---|
| 1795 | 1796 | if (magic_num != PLATFORM_CONFIG_MAGIC_NUM) { |
|---|
| 1796 | 1797 | dd_dev_err(dd, "%s: Bad config file\n", __func__); |
|---|
| 1798 | + ret = -EINVAL; |
|---|
| 1797 | 1799 | goto bail; |
|---|
| 1798 | 1800 | } |
|---|
| 1799 | 1801 | |
|---|
| .. | .. |
|---|
| 1817 | 1819 | if (file_length > dd->platform_config.size) { |
|---|
| 1818 | 1820 | dd_dev_info(dd, "%s:File claims to be larger than read size\n", |
|---|
| 1819 | 1821 | __func__); |
|---|
| 1822 | + ret = -EINVAL; |
|---|
| 1820 | 1823 | goto bail; |
|---|
| 1821 | 1824 | } else if (file_length < dd->platform_config.size) { |
|---|
| 1822 | 1825 | dd_dev_info(dd, |
|---|
| .. | .. |
|---|
| 1837 | 1840 | dd_dev_err(dd, "%s: Failed validation at offset %ld\n", |
|---|
| 1838 | 1841 | __func__, (ptr - (u32 *) |
|---|
| 1839 | 1842 | dd->platform_config.data)); |
|---|
| 1843 | + ret = -EINVAL; |
|---|
| 1840 | 1844 | goto bail; |
|---|
| 1841 | 1845 | } |
|---|
| 1842 | 1846 | |
|---|
| .. | .. |
|---|
| 1880 | 1884 | __func__, table_type, |
|---|
| 1881 | 1885 | (ptr - (u32 *) |
|---|
| 1882 | 1886 | dd->platform_config.data)); |
|---|
| 1887 | + ret = -EINVAL; |
|---|
| 1883 | 1888 | goto bail; /* We don't trust this file now */ |
|---|
| 1884 | 1889 | } |
|---|
| 1885 | 1890 | pcfgcache->config_tables[table_type].table = ptr; |
|---|
| .. | .. |
|---|
| 1899 | 1904 | __func__, table_type, |
|---|
| 1900 | 1905 | (ptr - |
|---|
| 1901 | 1906 | (u32 *)dd->platform_config.data)); |
|---|
| 1907 | + ret = -EINVAL; |
|---|
| 1902 | 1908 | goto bail; /* We don't trust this file now */ |
|---|
| 1903 | 1909 | } |
|---|
| 1904 | 1910 | pcfgcache->config_tables[table_type].table_metadata = |
|---|