summaryrefslogtreecommitdiffstats
path: root/net/rfkill/rfkill.c
diff options
context:
space:
mode:
authorIvo van Doorn <IvDoorn@gmail.com>2007-05-19 21:24:39 +0200
committerDavid S. Miller <davem@davemloft.net>2007-05-19 21:24:39 +0200
commitd007da1fa6f0ad5e01ceae4a1f60cdbb23ecd706 (patch)
treefa96a04b86164d8256e1c4fb533236148fcb0c4e /net/rfkill/rfkill.c
parent[IPV6]: Add ip6_tunnel.h to headers_install (diff)
downloadlinux-d007da1fa6f0ad5e01ceae4a1f60cdbb23ecd706.tar.xz
linux-d007da1fa6f0ad5e01ceae4a1f60cdbb23ecd706.zip
[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@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rfkill/rfkill.c')
-rw-r--r--net/rfkill/rfkill.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/rfkill/rfkill.c b/net/rfkill/rfkill.c
index a973603e3880..f3986d498b40 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);