Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e824fa42 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "wil6210: Fix potential memory leaks on error paths"

parents 6f259226 dd5abd3e
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -572,8 +572,10 @@ static ssize_t wil_write_file_txmgmt(struct file *file, const char __user *buf,
	if (!frame)
		return -ENOMEM;

	if (copy_from_user(frame, buf, len))
	if (copy_from_user(frame, buf, len)) {
		kfree(frame);
		return -EIO;
	}

	rc = wil_cfg80211_mgmt_tx(wiphy, wdev, wdev->preset_chandef.chan,
				true, 0, frame, len, true, false, NULL);
@@ -610,8 +612,10 @@ static ssize_t wil_write_file_wmi(struct file *file, const char __user *buf,
		return -ENOMEM;

	rc = simple_write_to_buffer(wmi, len, ppos, buf, len);
	if (rc < 0)
	if (rc < 0) {
		kfree(wmi);
		return rc;
	}

	cmd = &wmi[1];
	cmdid = le16_to_cpu(wmi->id);