[PATCH] orinoco: Fix memory leak on error in processing hostscan frames.
[sfrench/cifs-2.6.git] / 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
                {