[bug report] clk: tegra: Add closed loop support for the DFLL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Tuomas Tynkkynen,

The patch c4fe70ada40f: "clk: tegra: Add closed loop support for the
DFLL" from May 13, 2015 (linux-next), leads to the following Smatch
static checker warning:

	drivers/clk/tegra/clk-dfll.c:1828 dfll_fetch_i2c_params()
	error: 'regmap' dereferencing possible ERR_PTR()

drivers/clk/tegra/clk-dfll.c
    1816 static int dfll_fetch_i2c_params(struct tegra_dfll *td)
    1817 {
    1818         struct regmap *regmap;
    1819         struct device *i2c_dev;
    1820         struct i2c_client *i2c_client;
    1821         int vsel_reg, vsel_mask;
    1822         int ret;
    1823 
    1824         if (!read_dt_param(td, "nvidia,i2c-fs-rate", &td->i2c_fs_rate))
    1825                 return -EINVAL;
    1826 
    1827         regmap = regulator_get_regmap(td->vdd_reg);

regulator_get_regmap() can return error pointers.  Static checkers
*love* error checking.  :P

--> 1828         i2c_dev = regmap_get_device(regmap);
    1829         i2c_client = to_i2c_client(i2c_dev);
    1830 
    1831         td->i2c_slave_addr = i2c_client->addr;
    1832 
    1833         ret = regulator_get_hardware_vsel_register(td->vdd_reg,
    1834                                                    &vsel_reg,
    1835                                                    &vsel_mask);
    1836         if (ret < 0) {
    1837                 dev_err(td->dev,
    1838                         "regulator unsuitable for DFLL I2C operation\n");
    1839                 return -EINVAL;
    1840         }
    1841         td->i2c_reg = vsel_reg;
    1842 
    1843         return 0;
    1844 }

regards,
dan carpenter



[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux