Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753381AbdDLIdn (ORCPT ); Wed, 12 Apr 2017 04:33:43 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:23415 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751393AbdDLIdj (ORCPT ); Wed, 12 Apr 2017 04:33:39 -0400 Date: Wed, 12 Apr 2017 11:33:21 +0300 From: Dan Carpenter To: linux-kernel@vger.kernel.org, Rodolfo Giometti Cc: kernel-janitors@vger.kernel.org, Andrew Morton Subject: [PATCH] c2port: checking for NULL instead of IS_ERR() Message-ID: <20170412083321.GC3250@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.6.0 (2016-04-01) X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 759 Lines: 20 c2port_device_register() never returns NULL, it uses error pointers. Fixes: 65131cd52b9e ("c2port: add c2port support for Eurotech Duramar 2150") Signed-off-by: Dan Carpenter diff --git a/drivers/misc/c2port/c2port-duramar2150.c b/drivers/misc/c2port/c2port-duramar2150.c index 5484301d57d9..3dc61ea7dc64 100644 --- a/drivers/misc/c2port/c2port-duramar2150.c +++ b/drivers/misc/c2port/c2port-duramar2150.c @@ -129,8 +129,8 @@ static int __init duramar2150_c2port_init(void) duramar2150_c2port_dev = c2port_device_register("uc", &duramar2150_c2port_ops, NULL); - if (!duramar2150_c2port_dev) { - ret = -ENODEV; + if (IS_ERR(duramar2150_c2port_dev)) { + ret = PTR_ERR(duramar2150_c2port_dev); goto free_region; }