Signed-off-by: Pavel Roskin <proski@gnu.org>
Fix memory leak and unneeded unlock in orinoco_join_ap()
If orinoco_lock() fails, the code would still run orinoco_unlock(),
instead of freeing the allocated memory. Found by sparse.
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
return;
if (orinoco_lock(priv, &flags) != 0)
- goto out;
+ goto fail_lock;
/* Sanity checks in case user changed something in the meantime */
if (! priv->bssid_fixed)
printk(KERN_ERR "%s: Error issuing join request\n", dev->name);
out:
- kfree(buf);
orinoco_unlock(priv, &flags);
+
+ fail_lock:
+ kfree(buf);
}
/* Send new BSSID to userspace */