浏览代码

rtc: bq32k: remove redundant check

removing below static analysis error:
(error) Possible null pointer dereference: client

if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C))
							^^^^^^^
Error comes because client is dereferenced before NULL check.
So probably NULL this check is not required.

Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Maninder Singh 10 年之前
父节点
当前提交
617f6f7ef5
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/rtc/rtc-bq32k.c

+ 1 - 1
drivers/rtc/rtc-bq32k.c

@@ -212,7 +212,7 @@ static int bq32k_probe(struct i2c_client *client,
 	if (error)
 		return error;
 
-	if (client && client->dev.of_node)
+	if (client->dev.of_node)
 		trickle_charger_of_init(dev, client->dev.of_node);
 
 	rtc = devm_rtc_device_register(&client->dev, bq32k_driver.driver.name,