From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932377AbcDDLSX (ORCPT ); Mon, 4 Apr 2016 07:18:23 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:32093 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932066AbcDDLSU (ORCPT ); Mon, 4 Apr 2016 07:18:20 -0400 Date: Mon, 4 Apr 2016 14:17:36 +0300 From: Dan Carpenter To: Thomas Gleixner , MaJun Cc: Jason Cooper , Marc Zyngier , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] irqchip/mbigen: checking for IS_ERR() instead of NULL Message-ID: <20160404111736.GB26910@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org of_platform_device_create() returns NULL on error, it never returns error pointers. Fixes: ed2a1002d25c ('irqchip/mbigen: Handle multiple device nodes in a mbigen module') Signed-off-by: Dan Carpenter diff --git a/drivers/irqchip/irq-mbigen.c b/drivers/irqchip/irq-mbigen.c index d67baa2..03b79b0 100644 --- a/drivers/irqchip/irq-mbigen.c +++ b/drivers/irqchip/irq-mbigen.c @@ -263,8 +263,8 @@ static int mbigen_device_probe(struct platform_device *pdev) parent = platform_bus_type.dev_root; child = of_platform_device_create(np, NULL, parent); - if (IS_ERR(child)) - return PTR_ERR(child); + if (!child) + return -ENOMEM; if (of_property_read_u32(child->dev.of_node, "num-pins", &num_pins) < 0) {