Commit d848a2d
crypto: hisilicon/qm - Fix device reference leak in qm_get_qos_value
commit 59b0afd upstream.
The qm_get_qos_value() function calls bus_find_device_by_name() which
increases the device reference count, but fails to call put_device()
to balance the reference count and lead to a device reference leak.
Add put_device() calls in both the error path and success path to
properly balance the reference count.
Found via static analysis.
Fixes: 22d7a6c ("crypto: hisilicon/qm - add pci bdf number check")
Cc: stable@vger.kernel.org
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: Longfang Liu <liulongfang@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 665276c commit d848a2d
1 file changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3857 | 3857 | | |
3858 | 3858 | | |
3859 | 3859 | | |
| 3860 | + | |
3860 | 3861 | | |
3861 | 3862 | | |
3862 | 3863 | | |
3863 | 3864 | | |
| 3865 | + | |
3864 | 3866 | | |
3865 | 3867 | | |
3866 | 3868 | | |
| |||
0 commit comments