Commit dcdcc01b authored by Pan Bian's avatar Pan Bian Committed by Kleber Sacilotto de Souza

NFC: fdp: fix incorrect free object

BugLink: https://bugs.launchpad.net/bugs/1852335

[ Upstream commit 517ce4e9 ]

The address of fw_vsc_cfg is on stack. Releasing it with devm_kfree() is
incorrect, which may result in a system crash or other security impacts.
The expected object to free is *fw_vsc_cfg.
Signed-off-by: default avatarPan Bian <bianpan2016@163.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarConnor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent d25a1869
...@@ -268,7 +268,7 @@ static void fdp_nci_i2c_read_device_properties(struct device *dev, ...@@ -268,7 +268,7 @@ static void fdp_nci_i2c_read_device_properties(struct device *dev,
*fw_vsc_cfg, len); *fw_vsc_cfg, len);
if (r) { if (r) {
devm_kfree(dev, fw_vsc_cfg); devm_kfree(dev, *fw_vsc_cfg);
goto vsc_read_err; goto vsc_read_err;
} }
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment