Skip to contentSkip to conversation

scsi: advansys: fix improper function call to kfree

PATCH New Pan Bian 1 participant 1 message Nov 5, 2017

Subsystems (2)
lore
Share & tools
lore

Pan Bian

author
#0 lore raw

PATCH 1/1 scsi: advansys: fix improper function call to kfree

In function advansys_eisa_probe(), data->host[i] holds the return value of scsi_host_alloc(). The memory allocated by scsi_host_alloc() should be deallocated with scsi_host_put(), not kfree().

---
 drivers/scsi/advansys.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/advansys.c +2 -2
index 24e57e7..1f56a6d 100644
@@ -11678,8 +11678,8 @@ static int advansys_eisa_probe(struct device *dev)
 	return 0;
 
  free_data:
-	kfree(data->host[0]);
-	kfree(data->host[1]);
+	scsi_host_put(data->host[0]);
+	scsi_host_put(data->host[1]);
 	kfree(data);
  fail:
 	return err;
Signature · 1 line
1.9.1