diff options
author | Yang Yingliang <yangyingliang@huawei.com> | 2022-11-10 23:11:29 +0800 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2022-11-25 23:24:27 +0000 |
commit | 4ef174a3ad9b5d73c1b6573e244ebba2b0d86eac (patch) | |
tree | 021bef12fccbe070f5be7c37caf77fc23b9d0980 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | 78316e9dfc24906dd474630928ed1d3c562b568e (diff) |
scsi: hpsa: Fix error handling in hpsa_add_sas_host()
hpsa_sas_port_add_phy() does:
...
sas_phy_add() -> may return error here
sas_port_add_phy()
...
Whereas hpsa_free_sas_phy() does:
...
sas_port_delete_phy()
sas_phy_delete()
...
If hpsa_sas_port_add_phy() returns an error, hpsa_free_sas_phy() can not be
called to free the memory because the port and the phy have not been added
yet.
Replace hpsa_free_sas_phy() with sas_phy_free() and kfree() to avoid kernel
crash in this case.
Fixes: d04e62b9d63a ("hpsa: add in sas transport class")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20221110151129.394389-1-yangyingliang@huawei.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions