All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@osdl.org>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: netdev@vger.kernel.org
Subject: [PATCH 1/3] chelsio: fix error path
Date: Fri, 15 Dec 2006 11:07:17 -0800	[thread overview]
Message-ID: <20061215190813.630932000@osdl.org> (raw)
In-Reply-To: 20061215190716.956791000@osdl.org

[-- Attachment #1: chelsio-coverity.patch --]
[-- Type: text/plain, Size: 625 bytes --]

Fix handling of allocation failure.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>

--- linux-2.6.20-rc1.orig/drivers/net/chelsio/my3126.c
+++ linux-2.6.20-rc1/drivers/net/chelsio/my3126.c
@@ -170,13 +170,14 @@ static struct cphy *my3126_phy_create(ad
 {
 	struct cphy *cphy = kzalloc(sizeof (*cphy), GFP_KERNEL);
 
-	if (cphy)
-		cphy_init(cphy, adapter, phy_addr, &my3126_ops, mdio_ops);
+	if (!cphy)
+		return NULL;
 
+	cphy_init(cphy, adapter, phy_addr, &my3126_ops, mdio_ops);
 	INIT_DELAYED_WORK(&cphy->phy_update, my3216_poll);
 	cphy->bmsr = 0;
 
-	return (cphy);
+	return cphy;
 }
 
 /* Chip Reset */

-- 


  reply	other threads:[~2006-12-15 19:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-15 19:07 [PATCH 0/3] chelsio driver changes Stephen Hemminger
2006-12-15 19:07 ` Stephen Hemminger [this message]
2006-12-15 19:07 ` [PATCH 2/3] chelsio: NAPI speed improvement Stephen Hemminger
2006-12-15 19:07 ` [PATCH 3/3] chelsio: more receive cleanup Stephen Hemminger
2006-12-15 20:10   ` Francois Romieu
2006-12-15 22:55     ` Stephen Hemminger
2006-12-16  0:26       ` Francois Romieu
2006-12-16  1:28         ` Stephen Hemminger
2006-12-26 21:16 ` [PATCH 0/3] chelsio driver changes Jeff Garzik
2007-01-08 19:24   ` [PATCH 1/3] chelsio: error path fix Stephen Hemminger
     [not found]     ` <20070108112524.730e89f0@dxpl.pdx.osdl.net>
2007-01-08 19:26       ` [PATCH 3/3] chelsio: more rx speedup Stephen Hemminger
2007-01-09  8:42         ` Ingo Oeser
2007-01-09 18:26           ` Stephen Hemminger
2007-01-10  2:08             ` Divy Le Ray
2007-01-10  8:34               ` Ingo Oeser
2007-01-10  8:30             ` Ingo Oeser
2007-01-19  3:05         ` Jeff Garzik
2007-01-08 19:26     ` [PATCH 2/3] chelsio: NAPI speed improvement Stephen Hemminger
2007-01-19  3:05       ` Jeff Garzik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061215190813.630932000@osdl.org \
    --to=shemminger@osdl.org \
    --cc=jgarzik@pobox.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.