From patchwork Sat Jul 25 12:22:59 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 37320 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n6PCNCRY023224 for ; Sat, 25 Jul 2009 12:23:13 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752652AbZGYMXK (ORCPT ); Sat, 25 Jul 2009 08:23:10 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752588AbZGYMXK (ORCPT ); Sat, 25 Jul 2009 08:23:10 -0400 Received: from ey-out-2122.google.com ([74.125.78.27]:47777 "EHLO ey-out-2122.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752626AbZGYMXJ (ORCPT ); Sat, 25 Jul 2009 08:23:09 -0400 Received: by ey-out-2122.google.com with SMTP id 9so595782eyd.37 for ; Sat, 25 Jul 2009 05:23:08 -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=0BfGMIzPnjnttaUfX9FNM8uwkauu1eFEE0SXpCjaceM=; b=oIMdt6RHE8LicO9RrtJoncMJ9AkGwcT5UNUT4MeB3VRsi5G+faTfns2tWxM6Spf9Y2 xXfC06YFFejK4bHSe8pgFwmBIaDz6VKV111r2IIl9/+hvba2zWE22VA0NnBe7ne9Uzi5 J1zi0ghiEq+ZY3GhJyBpcX9Gw0lC6IBi70bNQ= 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=HvIQbAvGnY094g4iTRNNZF5JjhRuAM0sTaw4lnR2Ks33jFa45d/zGRxcH3MzcR6BQi h0w7d+Z4x+frsiYORutYsVT5nldUnoZ4jXI2WoXrHEGgPPPTAw5k1xVWA9pI36BocnVx dBi21pwmPQR62jNEiPosI1+Wtn3GMt/2HHEGk= Received: by 10.211.179.6 with SMTP id g6mr5570884ebp.94.1248524588468; Sat, 25 Jul 2009 05:23:08 -0700 (PDT) Received: from bicker.local (dsl-242-118-11.telkomadsl.co.za [41.242.118.11]) by mx.google.com with ESMTPS id 10sm1961045eyz.51.2009.07.25.05.23.04 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 25 Jul 2009 05:23:07 -0700 (PDT) Date: Sat, 25 Jul 2009 15:22:59 +0300 (EAT) From: Dan Carpenter X-X-Sender: dcarpenter@bicker To: samuel.ortiz@intel.com, yi.zhu@intel.com cc: linux-wireless@vger.kernel.org Subject: [patch] wireless: ERR_PTR vs null Message-ID: User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org iwm_wdev_alloc() returns an ERR_PTR on failure and not null. It also prints its own dev_err() message so I removed that as well. Compile tested only. Sorry. Found by smatch (http://repo.or.cz/w/smatch.git). regards, dan carpenter Signed-off-by: Dan Carpenter Acked-by: Zhu Yi --- To unsubscribe from this list: send the line "unsubscribe linux-wireless" 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/wireless/iwmc3200wifi/netdev.c 2009-07-24 09:56:49.000000000 +0300 +++ devel/drivers/net/wireless/iwmc3200wifi/netdev.c 2009-07-24 09:57:31.000000000 +0300 @@ -106,10 +106,8 @@ int ret = 0; wdev = iwm_wdev_alloc(sizeof_bus, dev); - if (!wdev) { - dev_err(dev, "no memory for wireless device instance\n"); - return ERR_PTR(-ENOMEM); - } + if (IS_ERR(wdev)) + return wdev; iwm = wdev_to_iwm(wdev); iwm->bus_ops = if_ops;