On Thu, Jan 18, 2024 at 09:54:06AM +0300, Dan Carpenter wrote: > Hello Tommaso Merciai, > > The patch 0a7af872915e: "media: i2c: Add support for alvium camera" > from Dec 4, 2023 (linux-next), leads to the following Smatch static > checker warning: > > drivers/media/i2c/alvium-csi2.c:420 alvium_get_fw_version() > error: uninitialized symbol 'spec'. > > drivers/media/i2c/alvium-csi2.c > 403 static int alvium_get_fw_version(struct alvium_dev *alvium) > 404 { > 405 struct device *dev = &alvium->i2c_client->dev; > 406 u64 spec, maj, min, pat; > 407 int ret = 0; > 408 > 409 ret = alvium_read(alvium, REG_BCRM_DEVICE_FW_SPEC_VERSION_R, > 410 &spec, &ret); > 411 ret = alvium_read(alvium, REG_BCRM_DEVICE_FW_MAJOR_VERSION_R, > 412 &maj, &ret); > 413 ret = alvium_read(alvium, REG_BCRM_DEVICE_FW_MINOR_VERSION_R, > 414 &min, &ret); > 415 ret = alvium_read(alvium, REG_BCRM_DEVICE_FW_PATCH_VERSION_R, > 416 &pat, &ret); > 417 if (ret) > 418 return ret; > > Only the last read is checked. Oops. Sorry for the noise. I hadn't seen that it takes &ret as an argument and so it preserves the first error code. regards, dan carpenter