rtc: bq32k: remove redundant check
authorManinder Singh <maninder1.s@samsung.com>
Wed, 8 Jul 2015 06:56:47 +0000 (12:26 +0530)
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>
Sat, 5 Sep 2015 11:19:05 +0000 (13:19 +0200)
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>
drivers/rtc/rtc-bq32k.c

index 92679df6d6e222dd12e4f2471f9e1b3109048c50..409de9f1b604c62e51742eb3ca71ffcab25cc087 100644 (file)
@@ -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,