From patchwork Thu Apr 9 07:55:29 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 25772 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id EB4ABDDFEC for ; Thu, 9 Apr 2009 17:56:19 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757771AbZDIHz4 (ORCPT ); Thu, 9 Apr 2009 03:55:56 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1760283AbZDIHzz (ORCPT ); Thu, 9 Apr 2009 03:55:55 -0400 Received: from qw-out-2122.google.com ([74.125.92.25]:18720 "EHLO qw-out-2122.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758660AbZDIHzy (ORCPT ); Thu, 9 Apr 2009 03:55:54 -0400 Received: by qw-out-2122.google.com with SMTP id 8so585262qwh.37 for ; Thu, 09 Apr 2009 00:55:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-x-sender:to:cc :subject:message-id:user-agent:mime-version:content-type; bh=olGzrrLWnEANfv/QURmeTmpvvGXNRFtigQIIkBSWmzs=; b=msgaunJGZeUTdQUYdbcTgbBkJPfUdwWTp3i9QK0TvI3dBqO5UgxAo2JJps2tksz24Q gFETlHeOVk6iUZnzJjd+ulw/1pZUFl3Z56awBbkixVhr44EfXcWNuKPFJxRnDsDdqf4D 4BNeQJf2HJ+ukZNMYqLMNo4bFGRD3LeKbyM5Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-x-sender:to:cc:subject:message-id:user-agent :mime-version:content-type; b=ikgOz390H4YRyYgmbxShOItyEg9bJHRET6PbDSNfCmH6BQnJKV06RI5A+O6SWbbTdw y/lf31aICUepM5b+ZOgiePaL6reRNXdydvWLBTYVBOJXofW0gOw/pLdgK8xBMhLdaBzj AroYLPy7YP1RQBLeOAMxcoDfiJ11UykhLQsDM= Received: by 10.224.6.136 with SMTP id 8mr2532432qaz.212.1239263752792; Thu, 09 Apr 2009 00:55:52 -0700 (PDT) Received: from bicker.local ([41.220.212.131]) by mx.google.com with ESMTPS id 7sm422668qwf.0.2009.04.09.00.55.48 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 09 Apr 2009 00:55:52 -0700 (PDT) Date: Thu, 9 Apr 2009 10:55:29 +0300 (EAT) From: Dan Carpenter X-X-Sender: dcarpenter@bicker To: vbordug@ru.mvista.com, avorontsov@ru.mvista.com cc: netdev@vger.kernel.org Subject: [patch] error handling for platform_device_register_simple() Message-ID: User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org platform_device_register_simple() returns ERR_PTR() and not NULL. Found by smatch (http://repo.or.cz/w/smatch.git). Compile tested. regards, dan carpenter Signed-off-by: Dan Carpenter --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- orig/drivers/net/phy/fixed.c 2009-04-09 05:53:24.000000000 +0300 +++ devel/drivers/net/phy/fixed.c 2009-04-09 05:53:52.000000000 +0300 @@ -207,8 +207,8 @@ int ret; pdev = platform_device_register_simple("Fixed MDIO bus", 0, NULL, 0); - if (!pdev) { - ret = -ENOMEM; + if (IS_ERR(pdev)) { + ret = PTR_ERR(pdev); goto err_pdev; }