diff options
author | Pan Bian <bianpan2016@163.com> | 2019-11-05 11:34:07 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-11-12 21:13:15 +0300 |
commit | a5f9f1aca5d55a986e3faf648c7067d9ae24574f (patch) | |
tree | 2ac98342ff148e368c82c38c7ae7d18fff33e193 /drivers/nfc | |
parent | 817e5140ed12cfb67f8d33de75dccce03895230d (diff) | |
download | linux-a5f9f1aca5d55a986e3faf648c7067d9ae24574f.tar.xz |
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.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nfc/fdp/i2c.c b/drivers/nfc/fdp/i2c.c index a5d7332dfce5..a54e67cf0493 100644 --- a/drivers/nfc/fdp/i2c.c +++ b/drivers/nfc/fdp/i2c.c @@ -268,7 +268,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 { |