[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <200705191408.44138.IvDoorn@gmail.com>
Date: Sat, 19 May 2007 14:08:43 +0200
From: Ivo van Doorn <ivdoorn@...il.com>
To: davem@...emloft.net
Cc: Eric Sesterhenn / Snakebyte <snakebyte@....de>,
Dmitry Torokhov <dtor@...ightbb.com>, netdev@...r.kernel.org,
akpm@...ux-foundation.org
Subject: [PATCH] rfkill: Fix check for correct rfkill allocation
coverity has spotted a bug in rfkill.c (bug id #1627),
in rfkill_allocate() NULL was returns if the kzalloc() works,
and deref the NULL pointer if it fails,
Signed-off-by: Ivo van Doorn <IvDoorn@...il.com>
---
diff --git a/net/rfkill/rfkill.c b/net/rfkill/rfkill.c
index a973603..f3986d4 100644
--- a/net/rfkill/rfkill.c
+++ b/net/rfkill/rfkill.c
@@ -296,7 +296,7 @@ struct rfkill *rfkill_allocate(struct device *parent, enum rfkill_type type)
struct device *dev;
rfkill = kzalloc(sizeof(struct rfkill), GFP_KERNEL);
- if (rfkill)
+ if (!rfkill)
return NULL;
mutex_init(&rfkill->mutex);
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists