Skip to contentSkip to conversation

drivers/media/i2c/imx274.c:1864 imx274_probe() error: uninitialized symbol 'ret'.

PATCH New Dan Carpenter 1 participant 1 message Nov 16, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 4/31 drivers/media/i2c/imx274.c:1864 imx274_probe() error: uninitialized symbol 'ret'.

tree:   git://linuxtv.org/hverkuil/media_tree.git tegrav7
head:   21fdf53e9b25740c154944080601db0d0009f791
commit: 75bf8f97326c56ba2249f66b1ba86a4e1055e5d0 [4/31] media: i2c: Add support for IMX274 supplies and external clock
config: x86_64-randconfig-m001-20201113 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate

smatch warnings:
drivers/media/i2c/imx274.c:1864 imx274_probe() error: uninitialized symbol 'ret'.

vim +/ret +1864 drivers/media/i2c/imx274.c

e671499303e4c0e Kieran Bingham      2019-07-10  1848  static int imx274_probe(struct i2c_client *client)
0985dd306f727df Leon Luo            2017-10-05  1849  {
0985dd306f727df Leon Luo            2017-10-05  1850  	struct v4l2_subdev *sd;
0985dd306f727df Leon Luo            2017-10-05  1851  	struct stimx274 *imx274;
0985dd306f727df Leon Luo            2017-10-05  1852  	int ret;
0985dd306f727df Leon Luo            2017-10-05  1853  
0985dd306f727df Leon Luo            2017-10-05  1854  	/* initialize imx274 */
0985dd306f727df Leon Luo            2017-10-05  1855  	imx274 = devm_kzalloc(&client->dev, sizeof(*imx274), GFP_KERNEL);
0985dd306f727df Leon Luo            2017-10-05  1856  	if (!imx274)
0985dd306f727df Leon Luo            2017-10-05  1857  		return -ENOMEM;
0985dd306f727df Leon Luo            2017-10-05  1858  
0985dd306f727df Leon Luo            2017-10-05  1859  	mutex_init(&imx274->lock);
0985dd306f727df Leon Luo            2017-10-05  1860  
75bf8f97326c56b Sowjanya Komatineni 2020-06-03  1861  	imx274->xclk = devm_clk_get(&client->dev, "xclk");
75bf8f97326c56b Sowjanya Komatineni 2020-06-03  1862  	if (IS_ERR(imx274->xclk)) {
75bf8f97326c56b Sowjanya Komatineni 2020-06-03  1863  		dev_err(&client->dev, "Failed to get xclk\n");

75bf8f97326c56b Sowjanya Komatineni 2020-06-03 @1864 return ret;

This should be "return PTR_ERR(imx274->xclk);

75bf8f97326c56b Sowjanya Komatineni 2020-06-03  1865  	}
75bf8f97326c56b Sowjanya Komatineni 2020-06-03  1866  
75bf8f97326c56b Sowjanya Komatineni 2020-06-03  1867  	ret = clk_set_rate(imx274->xclk, IMX274_DEFAULT_CLK_FREQ);
75bf8f97326c56b Sowjanya Komatineni 2020-06-03  1868  	if (ret < 0) {
75bf8f97326c56b Sowjanya Komatineni 2020-06-03  1869  		dev_err(&client->dev, "Failed to set xclk rate\n");
75bf8f97326c56b Sowjanya Komatineni 2020-06-03  1870  		return ret;
75bf8f97326c56b Sowjanya Komatineni 2020-06-03  1871  	}
75bf8f97326c56b Sowjanya Komatineni 2020-06-03  1872  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org