summaryrefslogtreecommitdiff
path: root/drivers/nfc
diff options
context:
space:
mode:
authorPan Bian <bianpan2016@163.com>2019-11-05 16:34:07 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-11-12 19:17:53 +0100
commit5f311e37e9592bbfebac148135ed39ede2ad0d10 (patch)
treedc1e76959793644d3d1da085cd3dd0fdbce2c26a /drivers/nfc
parentc7c24046c8e970fdda5c6f3998b728fb7f0b49df (diff)
NFC: fdp: fix incorrect free object
[ Upstream commit 517ce4e93368938b204451285e53014549804868 ] 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: Pan Bian <bianpan2016@163.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/nfc')
-rw-r--r--drivers/nfc/fdp/i2c.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nfc/fdp/i2c.c b/drivers/nfc/fdp/i2c.c
index c4da50e07bbc..4020c11a9415 100644
--- a/drivers/nfc/fdp/i2c.c
+++ b/drivers/nfc/fdp/i2c.c
@@ -267,7 +267,7 @@ static void fdp_nci_i2c_read_device_properties(struct device *dev,
*fw_vsc_cfg, len);
if (r) {
- devm_kfree(dev, fw_vsc_cfg);
+ devm_kfree(dev, *fw_vsc_cfg);
goto vsc_read_err;
}
} else {