Explorar o código

exofs: Fix bio leak in error handling path (sync read)

When failing a read request in the sync path, called from
write_begin, I forgot to free the allocated bio, fix it.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Boaz Harrosh %!s(int64=16) %!d(string=hai) anos
pai
achega
b76a3f93d0
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      fs/exofs/inode.c

+ 3 - 0
fs/exofs/inode.c

@@ -295,6 +295,9 @@ static int read_exec(struct page_collect *pcol, bool is_sync)
 err:
 err:
 	if (!is_sync)
 	if (!is_sync)
 		_unlock_pcol_pages(pcol, ret, READ);
 		_unlock_pcol_pages(pcol, ret, READ);
+	else /* Pages unlocked by caller in sync mode only free bio */
+		pcol_free(pcol);
+
 	kfree(pcol_copy);
 	kfree(pcol_copy);
 	if (or)
 	if (or)
 		osd_end_request(or);
 		osd_end_request(or);