提交 760a1f7f 编写于 作者: P Pan Bian 提交者: Greg Kroah-Hartman

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: NPan Bian <bianpan2016@163.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 5580091c
...@@ -267,7 +267,7 @@ static void fdp_nci_i2c_read_device_properties(struct device *dev, ...@@ -267,7 +267,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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册