Skip to contentSkip to conversation

vdev: free reply.msgs memory for secondary process

PATCH In review paul luse 2 participants 2 messages Sep 20, 2018 – Sep 21, 2018

lore
Share & tools
lore

paul luse

author
#0 lore raw

PATCH 1/1 vdev: free reply.msgs memory for secondary process

This patch fixes an issue caught with ASAN where a vdev_scan() to a secondary bus was failing to free some memory.

---
 drivers/bus/vdev/vdev.c | 1 +
 1 file changed, 1 insertion(+)
drivers/bus/vdev/vdev.c +1 -0
index 69dee89a8..2566d6c0d 100644
@@ -423,6 +423,7 @@ vdev_scan(void)
 			mp_rep = &mp_reply.msgs[0];
 			resp = (struct vdev_param *)mp_rep->param;
 			VDEV_LOG(INFO, "Received %d vdevs", resp->num);
+			free(mp_reply.msgs);
 		} else
 			VDEV_LOG(ERR, "Failed to request vdev from primary");
 
Signature · 1 line
2.17.1 (Apple Git-112)
Acked-by on v1 1/1
#1 lore raw
Quoted 14 lines · paul luse

This patch fixes an issue caught with ASAN where a vdev_scan() to a secondary bus was failing to free some memory.

---
  drivers/bus/vdev/vdev.c | 1 +
  1 file changed, 1 insertion(+)
drivers/bus/vdev/vdev.c +0 -0
index 69dee89a8..2566d6c0d 100644

drivers/bus/vdev/vdev.c vdev_scan(void) · line 429

Quoted 7 lines
drivers/bus/vdev/vdev.c +1 -0
@@ -423,6 +423,7 @@ vdev_scan(void)
  			mp_rep = &mp_reply.msgs[0];
  			resp = (struct vdev_param *)mp_rep->param;
  			VDEV_LOG(INFO, "Received %d vdevs", resp->num);
+			free(mp_reply.msgs);
  		} else
  			VDEV_LOG(ERR, "Failed to request vdev from primary");
 
Signature · 2 lines
Thanks,
Anatoly