projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4ef174a
)
scsi: hpsa: Fix possible memory leak in hpsa_add_sas_device()
author
Yang Yingliang
<yangyingliang@huawei.com>
Fri, 11 Nov 2022 04:30:12 +0000
(12:30 +0800)
committer
Martin K. Petersen
<martin.petersen@oracle.com>
Fri, 25 Nov 2022 23:36:23 +0000
(23:36 +0000)
If hpsa_sas_port_add_rphy() returns an error, the 'rphy' allocated in
sas_end_device_alloc() needs to be freed. Address this by calling
sas_rphy_free() in the error path.
Fixes:
d04e62b9d63a
("hpsa: add in sas transport class")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link:
https://lore.kernel.org/r/20221111043012.1074466-1-yangyingliang@huawei.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/hpsa.c
patch
|
blob
|
history
diff --git
a/drivers/scsi/hpsa.c
b/drivers/scsi/hpsa.c
index
6696967
..
4dbf51e
100644
(file)
--- a/
drivers/scsi/hpsa.c
+++ b/
drivers/scsi/hpsa.c
@@
-9823,10
+9823,12
@@
static int hpsa_add_sas_device(struct hpsa_sas_node *hpsa_sas_node,
rc = hpsa_sas_port_add_rphy(hpsa_sas_port, rphy);
if (rc)
- goto free_sas_
port
;
+ goto free_sas_
rphy
;
return 0;
+free_sas_rphy:
+ sas_rphy_free(rphy);
free_sas_port:
hpsa_free_sas_port(hpsa_sas_port);
device->sas_port = NULL;