[PATCH] orinoco: Fix memory leak on error in processing hostscan frames.
authorPavel Roskin <proski@gnu.org>
Fri, 2 Sep 2005 00:05:19 +0000 (20:05 -0400)
committerJeff Garzik <jgarzik@pobox.com>
Mon, 5 Sep 2005 22:13:44 +0000 (18:13 -0400)
Signed-off-by: Pavel Roskin <proski@gnu.org>
diff-tree ca955293cdfd3139e150d3b4fed3922a7eb651fb (from cb289b9f9b2a0f3ae7070a008f22e383b37526ee)
Author: Pavel Roskin <proski@gnu.org>
Date:   Thu Sep 1 19:08:00 2005 -0400

    Fix memory leak on error in processing hostscan frames.
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
drivers/net/wireless/orinoco.c

index 223d357953506c47b394e4f206da281ab96bf9cc..95eb05abc44ac61623e1860516386c45a766c5ce 100644 (file)
@@ -1284,8 +1284,10 @@ static void __orinoco_ev_info(struct net_device *dev, hermes_t *hw)
                /* Read scan data */
                err = hermes_bap_pread(hw, IRQ_BAP, (void *) buf, len,
                                       infofid, sizeof(info));
-               if (err)
+               if (err) {
+                       kfree(buf);
                        break;
+               }
 
 #ifdef ORINOCO_DEBUG
                {