Browse Source

kncasic: We need to free queued work to avoid memory leaks

Vitalii Demianets 11 years ago
parent
commit
61801c7357
1 changed files with 2 additions and 0 deletions
  1. 2 0
      driver-kncasic.c

+ 2 - 0
driver-kncasic.c

@@ -631,6 +631,8 @@ static int knc_core_send_work(struct thr_info *thr, struct knc_core_state *core,
 		goto error;
 	}
 
+	if (core->workslot[2].work)
+		free_work(core->workslot[2].work);
 	core->workslot[2].work = work;
 	core->workslot[2].slot = slot;
 	core->works++;