Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965974AbcKJUQQ (ORCPT ); Thu, 10 Nov 2016 15:16:16 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:60459 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933923AbcKJUQP (ORCPT ); Thu, 10 Nov 2016 15:16:15 -0500 X-IronPort-AV: E=Sophos;i="5.31,619,1473112800"; d="scan'208";a="244543357" Date: Thu, 10 Nov 2016 21:16:13 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Dmitry Torokhov cc: kbuild-all@01.org, devel@driverdev.osuosl.org, Greg Kroah-Hartman , Olof Johansson , Guenter Roeck , Thierry Escande , linux-kernel@vger.kernel.org Subject: [PATCH] driver-core: 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 Content-Length: 1138 Lines: 32 PTR_ERR should access the value just tested by IS_ERR Generated by: scripts/coccinelle/tests/odd_ptr_err.cocci CC: Dmitry Torokhov Signed-off-by: Julia Lawall Signed-off-by: Fengguang Wu --- 0-day warning related to the following commit: tree: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git driver-core-testing head: dfea747d2aba77443acf7ce6fa37caa729bd034c commit: 79543cf2b18ea4a35f8864849d7ad8882ea8a23d [10/14] driver-core: add test module for asynchronous probing I haven't checked the context in detail. test_async_driver_probe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/base/test/test_async_driver_probe.c +++ b/drivers/base/test/test_async_driver_probe.c @@ -119,7 +119,7 @@ static int __init test_async_probe_init( sync_dev_1 = platform_device_register_simple("test_sync_driver", 1, NULL, 0); if (IS_ERR(async_dev_1)) { - error = PTR_ERR(sync_dev_1); + error = PTR_ERR(async_dev_1); pr_err("failed to create sync_dev_1: %d", error); goto err_unregister_sync_driver; }