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

Commit 770f750b authored by Szymon Janc's avatar Szymon Janc Committed by Samuel Ortiz
Browse files

NFC: pn533: Fix use after free



cmd was freed in pn533_dep_link_up regardless of
pn533_send_cmd_frame_async return code. Cmd is passed as argument to
pn533_in_dep_link_up_complete callback and should be freed there.

Signed-off-by: default avatarSzymon Janc <szymon.janc@tieto.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 60ad07ab
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -1820,11 +1820,7 @@ static int pn533_dep_link_up(struct nfc_dev *nfc_dev, struct nfc_target *target,
	rc = pn533_send_cmd_frame_async(dev, dev->out_frame, dev->in_frame,
				dev->in_maxlen,	pn533_in_dep_link_up_complete,
				cmd, GFP_KERNEL);
	if (rc)
		goto out;


out:
	if (rc < 0)
		kfree(cmd);

	return rc;