From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759017AbdACNkw (ORCPT ); Tue, 3 Jan 2017 08:40:52 -0500 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:18816 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758962AbdACNkD (ORCPT ); Tue, 3 Jan 2017 08:40:03 -0500 X-IronPort-AV: E=Sophos;i="5.33,451,1477954800"; d="scan'208";a="206806072" Date: Tue, 3 Jan 2017 14:39:56 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Jaechul Lee cc: Dmitry Torokhov , Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon , Kukjin Kim , Krzysztof Kozlowski , Javier Martinez Canillas , kbuild-all@01.org, Jaechul Lee , Andi Shyti , Chanwoo Choi , beomho.seo@samsung.com, galaxyra@gmail.com, linux-arm-kernel@lists.infradead.org, linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH] input: tm2-touchkey: fix odd_ptr_err.cocci warnings Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org PTR_ERR should access the value just tested by IS_ERR Generated by: scripts/coccinelle/tests/odd_ptr_err.cocci CC: Jaechul Lee Signed-off-by: Julia Lawall Signed-off-by: Fengguang Wu --- I have only looked at the extract of code that is shown here. It could be the test that is wrong. The code comes from: url: https://github.com/0day-ci/linux/commits/Jaechul-Lee/Add-touch-key-driver-su pport-for-TM2/20170103-183357 :::::: branch date: 2 hours ago :::::: commit date: 2 hours ago tm2-touchkey.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/input/keyboard/tm2-touchkey.c +++ b/drivers/input/keyboard/tm2-touchkey.c @@ -196,7 +196,7 @@ static int tm2_touchkey_probe(struct i2c devm_regulator_get(&client->dev, "vdd"); if (IS_ERR(samsung_touchkey->regulator_vdd)) { dev_err(&client->dev, "Failed to get vdd regulator\n"); - return PTR_ERR(samsung_touchkey->regulator_vcc); + return PTR_ERR(samsung_touchkey->regulator_vdd); } /* power */