* [rtc-linux] [PATCH 1/1] drivers/rtc/rtc-bq32k.c: remove redundant check
@ 2015-07-08 6:56 ` Maninder Singh
0 siblings, 0 replies; 5+ messages in thread
From: Maninder Singh @ 2015-07-08 6:56 UTC (permalink / raw)
To: a.zummo, alexandre.belloni, rtc-linux, linux-kernel
Cc: pankaj.m, Maninder Singh
removing below static analysis error:-
(error) Possible null pointer dereference: client
if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C))
^^^^^^^
Error comes beacause client is dereferenced before NULL check.
So probabily NULL this check is not required.
Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
---
drivers/rtc/rtc-bq32k.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-bq32k.c b/drivers/rtc/rtc-bq32k.c
index 92679df..409de9f 100644
--- a/drivers/rtc/rtc-bq32k.c
+++ b/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,
--
1.7.9.5
--
--
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
---
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 1/1] drivers/rtc/rtc-bq32k.c: remove redundant check
@ 2015-07-08 6:56 ` Maninder Singh
0 siblings, 0 replies; 5+ messages in thread
From: Maninder Singh @ 2015-07-08 6:56 UTC (permalink / raw)
To: a.zummo, alexandre.belloni, rtc-linux, linux-kernel
Cc: pankaj.m, Maninder Singh
removing below static analysis error:-
(error) Possible null pointer dereference: client
if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C))
^^^^^^^
Error comes beacause client is dereferenced before NULL check.
So probabily NULL this check is not required.
Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
---
drivers/rtc/rtc-bq32k.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-bq32k.c b/drivers/rtc/rtc-bq32k.c
index 92679df..409de9f 100644
--- a/drivers/rtc/rtc-bq32k.c
+++ b/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,
--
1.7.9.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [rtc-linux] Re: [PATCH 1/1] drivers/rtc/rtc-bq32k.c: remove redundant check
2015-07-08 6:56 ` Maninder Singh
@ 2015-07-14 22:41 ` Alexandre Belloni
-1 siblings, 0 replies; 5+ messages in thread
From: Alexandre Belloni @ 2015-07-14 22:41 UTC (permalink / raw)
To: Maninder Singh; +Cc: a.zummo, rtc-linux, linux-kernel, pankaj.m
Hi,
On 08/07/2015 at 12:26:47 +0530, Maninder Singh wrote :
> removing below static analysis error:-
What tool did you use?
> (error) Possible null pointer dereference: client
>
> if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C))
> ^^^^^^^
> Error comes beacause client is dereferenced before NULL check.
> So probabily NULL this check is not required.
>
> Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
> ---
> drivers/rtc/rtc-bq32k.c | 2 +-
Applied, to rtc-next.
--
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
--
--
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
---
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] drivers/rtc/rtc-bq32k.c: remove redundant check
@ 2015-07-14 22:41 ` Alexandre Belloni
0 siblings, 0 replies; 5+ messages in thread
From: Alexandre Belloni @ 2015-07-14 22:41 UTC (permalink / raw)
To: Maninder Singh; +Cc: a.zummo, rtc-linux, linux-kernel, pankaj.m
Hi,
On 08/07/2015 at 12:26:47 +0530, Maninder Singh wrote :
> removing below static analysis error:-
What tool did you use?
> (error) Possible null pointer dereference: client
>
> if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C))
> ^^^^^^^
> Error comes beacause client is dereferenced before NULL check.
> So probabily NULL this check is not required.
>
> Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
> ---
> drivers/rtc/rtc-bq32k.c | 2 +-
Applied, to rtc-next.
--
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* [rtc-linux] Re: [PATCH 1/1] drivers/rtc/rtc-bq32k.c: remove redundant check
@ 2015-07-15 3:12 Maninder Singh
0 siblings, 0 replies; 5+ messages in thread
From: Maninder Singh @ 2015-07-15 3:12 UTC (permalink / raw)
To: Alexandre Belloni
Cc: a.zummo@towertech.it, rtc-linux@googlegroups.com, PANKAJ MISHRA
Hello
>> removing below static analysis error:-
>What tool did you use?
Its coverity analysis (static analysis) tool.
Or you can also use cppcheck tool.
>> (error) Possible null pointer dereference: client
>>
>> if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C))
>> ^^^^^^^
>> Error comes beacause client is dereferenced before NULL check.
>> So probabily NULL this check is not required.
>>
>> Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
>> ---
>> drivers/rtc/rtc-bq32k.c | 2 +-
>Applied, to rtc-next.
Thanks.
Maninder
............
--
--
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
---
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-07-15 3:12 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-08 6:56 [rtc-linux] [PATCH 1/1] drivers/rtc/rtc-bq32k.c: remove redundant check Maninder Singh
2015-07-08 6:56 ` Maninder Singh
2015-07-14 22:41 ` [rtc-linux] " Alexandre Belloni
2015-07-14 22:41 ` Alexandre Belloni
-- strict thread matches above, loose matches on Subject: below --
2015-07-15 3:12 [rtc-linux] " Maninder Singh
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.