Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932427AbbGHG5a (ORCPT ); Wed, 8 Jul 2015 02:57:30 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:60639 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754247AbbGHG5X (ORCPT ); Wed, 8 Jul 2015 02:57:23 -0400 X-AuditID: cbfee68e-f79c56d000006efb-9d-559cc9d1c414 From: Maninder Singh To: a.zummo@towertech.it, alexandre.belloni@free-electrons.com, rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org Cc: pankaj.m@samsung.com, Maninder Singh Subject: [PATCH 1/1] drivers/rtc/rtc-bq32k.c: remove redundant check Date: Wed, 08 Jul 2015 12:26:47 +0530 Message-id: <1436338607-43389-1-git-send-email-maninder1.s@samsung.com> X-Mailer: git-send-email 1.7.9.5 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrDLMWRmVeSWpSXmKPExsWyRsSkRvfiyTmhBl3zFS2WXLzKbtFxbTGT xeVdc9gsDs9vY7G492Yrk8X+zg5GBzaPJ5suMnrsmXiSzaNvyypGj+nzfjJ5fN4kF8AaxWWT kpqTWZZapG+XwJVxeEkPW0Eve8WBp+dYGxh/snYxcnJICJhInDn8lAnCFpO4cG89WxcjF4eQ wFJGic1/LzPDFDUtvMkMkZjOKHH6xzJGCOcno8TRizfZQarYBPQkVu3awwJiiwhUSWzp7gOK c3AwCzhJTP+qBxIWFnCRaFvUwAYSZhFQlThy0A8kzCvgLvF89x+wagkBBYk5k2xApksIfGeT uHCrG2w6i4CAxLfJh1ggamQlNh2AOk1S4uCKGywTGAUXMDKsYhRNLUguKE5KLzLSK07MLS7N S9dLzs/dxAgM1NP/nvXtYLx5wPoQowAHoxIPr0fMnFAh1sSy4srcQ4ymQBsmMkuJJucD4yGv JN7Q2MzIwtTE1NjI3NJMSZw3QepnsJBAemJJanZqakFqUXxRaU5q8SFGJg5OqQbGhhtPLvzw Wm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R: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1125 Lines: 34 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 --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/