[PATCH] hostap: Fix double free in prism2_config() error path
authorEugene Teo <eugene.teo@eugeneteo.net>
Mon, 20 Mar 2006 03:21:46 +0000 (19:21 -0800)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 23 Mar 2006 21:16:57 +0000 (16:16 -0500)
The Coverity checker (CID: 930) spotted this double free on error path
(allocation failure). Do not free these here since generic error path
will take care of this.

Signed-off-by: Eugene Teo <eugene.teo@eugeneteo.net>
Signed-off-by: Jouni Malinen <jkmaline@cc.hut.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/hostap/hostap_cs.c

index f8f4503475f99c16de7e553a52567f700a361f52..d335b250923a18dfcb1a67369edf95ca43fea31c 100644 (file)
@@ -585,8 +585,6 @@ static int prism2_config(dev_link_t *link)
        parse = kmalloc(sizeof(cisparse_t), GFP_KERNEL);
        hw_priv = kmalloc(sizeof(*hw_priv), GFP_KERNEL);
        if (parse == NULL || hw_priv == NULL) {
-               kfree(parse);
-               kfree(hw_priv);
                ret = -ENOMEM;
                goto failed;
        }